goal is to calculate lotsize based on maximum deposit currency to risk, eg, signalled trade has calculated stoploss of 1.43 pips, but I only want to risk $30.00...I think the following should do it, but am not sure. Any guidance would be appreciated...
Inserted Code
//variables... extern double risk.amt = 30; //amount of deposit currency to risk on trade double tv, sl.pips, lots; //tv=pair tick value, sl.pips=number of stoploss pips int pd; //Count of digits after decimal point in the symbol prices. tv=MarketInfo(Symbol(),16);//$0.903 ibfx gbpjpy mini account pd=MarketInfo(Symbol(),12);//2 digits gbpjpy /*sl.pips taken from separate, more complex equation*/ if(pd==4) sl.pips=sl.pips*10000; if(pd==2) sl.pips=sl.pips*100; lots=(risk.amt/sl.pips)*tv; /*lots=(30/143)*0.903; lots=0.19; $30 risked, 143 pip gbpjpy stoploss given a per tick value of $0.903. */