Maximum available lots per trade

 

Hi Guys,

I'm trying to write a code so that each trade is executed with the maximum available lots according to my account balance, but I am receiving a '*' constant expected error the whole time. Could anyone giving me some advise on how to fix this?

I have LotSize in my OrderSend code  

         double AccountBalance = AccountInfoDouble(ACCOUNT_BALANCE);
         double Leverage = AccountInfoInteger(ACCOUNT_LEVERAGE);
         extern double LotSize = ((((AccountBalance/Ask)*Leverage) - 1)*0.0001);

Thanks in advance!

Anton

 

         extern double LotSize = ((((AccountBalance/Ask)*Leverage) - 1)*0.0001);
extern is an input so it cannot be the result of a calculation. Remove extern and just make it a double.
 
Keith Watford:

         extern double LotSize = ((((AccountBalance/Ask)*Leverage) - 1)*0.0001);
extern is an input so it cannot be the result of a calculation. Remove extern and just make it a double.
Thanks Keith, I really appreciate it!
Reason: