So to keep it simple, I would suggest that the formulas I posted in the other post would be the easiest to reference, as I KNOW that works.
If you need to separate out a different value(E.g if you wanted the formula for stopsize), you can just algebraically solve for whatever value you need. Those formulas are below to calculate lot-size/position-size. For reference...
- myRisk = is the USD dollar amount you would want to risk(E.g... 24.32, would be risking $24.32)
- myStop = a value in number of pips. Not pipettes, but pips. So if on your tool it spanned a distance on Eur/Usd from 1.2020 to 1.2010... that would represent a value of 10
- decimalVal = 0.01 for any pair containing JPY, and 0.0001 for all other pairs
- exchangeRate = represents the appropriate USD pair price you have to multiply or divide by(the seven added dataseries)
lotSize = (myRisk/myStop) * (1/decimalVal) ; lotSize = ((exchangeRate * myRisk) / myStop) * (1/decimalVal) ; lotSize = ((myRisk/exchangeRate )/myStop) * (1/decimalVal) ; lotSize = ((myRisk*exchangeRate )/myStop) * (1/decimalVal) ;
For example, if you detect on initial load that the pair is Eur/Gbp... you could have a long IF, or SWITCH statement that would ONLY load the Gbp/Usd as the additional series.
Comment