I dont know why I cant figure this out right now but if someone could help me straighten my code out i would appreciate it.
I am trying to calculate Lot size by the amount of pips inbetween my future SL which is the previous bar high and current bid/ask price.
Here is what I have and is giving me error 131
I am on a 5 digit broker and the value of RiskPercent is a externdouble set at 0.02
Thank you
I am trying to calculate Lot size by the amount of pips inbetween my future SL which is the previous bar high and current bid/ask price.
Here is what I have and is giving me error 131
I am on a 5 digit broker and the value of RiskPercent is a externdouble set at 0.02
Inserted Code
double PrevHigh=High[1]+(SLpips*Point); double RiskPips = NormalizeDouble(PrevHigh,Digits)-NormalizeDouble(Bid,Digits); int spread=MarketInfo(Symbol(), MODE_SPREAD); double TickValue = MarketInfo(Symbol(),MODE_TICKVALUE); double PipsAtRisk = RiskPips/Point; double AccDollarToRisk = (AccountEquity()*RiskPercent); double SLDollarAmount= PipsAtRisk * TickValue; double Lots = AccDollarToRisk / SLDollarAmount; double Lot = Lots * TickValue; double lotsize = NormalizeDouble(Lot,2);