Hello,

The return type of GetAccountValue function is string.
http://www.amibroker.com/at/
You need to convert it to numer using StrToNum()
as described in the documentation.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "spi_maker" <[email protected]>
To: <[email protected]>
Sent: Thursday, August 06, 2009 5:37 PM
Subject: [amibroker] StaticVarGet & Type Mismatch


> For these statements
> 
>  StaticVarSet("Trade_Amount", 10000);
>  Available_Cash = ibc.GetAccountValue("CashBalance")
>  if(StaticVarGet("Trade_Amount") > Available_Cash)
>    {
>      StaticVarSet("Trade_Amount", Available_Cash);
>    }
>  _TRACE("Trade_Amount " + StaticVarGet("Trade_Amount") + " Available_Cash " + 
> Available_Cash);
> 
> Trace Results
> Trade_Amount 10000.0 Available_Cash 123456.78
> 
> Error 1: Operation not allowed. Operator/operand type mismatch.
> (Referring to if(StaticVarGet("Trade_Amount"
> 
> I am curious why I am getting the type mismatch error and if there are any 
> ideas for a workaround.
> 
> Thanks in advance
> 
> 
> 
> 
> ------------------------------------
> 
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
> 
> TO GET TECHNICAL SUPPORT send an e-mail directly to 
> SUPPORT {at} amibroker.com
> 
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
> 
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
> 
> Yahoo! Groups Links
> 
> 
> 

Reply via email to