How to normalize a volume according to each symbol.
Hi guys, I'm migrating my trading strategy from cAlgo to PTMC, but I have a problem with the pipValue. First, in cAlgo platform the pipSize for EURUSD is 0.0001 and here is 0.00001 so I have the doubt about this disparity. Second, I don´t know how to take the minimum volume to trade in any instrument. Third, how the pip Value formula is pipSize * volume, I can't get the pip Value at the moment.
Thanks Guys!
Replies
Hi, Juan!
This links will be helpful:
https://protrader.org/ptmc-api/netscript/instrument/precision
https://protrader.org/ptmc-api/netscript/instrument/lotsize
https://protrader.org/ptmc-api/netscript/instrument/ticksizehttps://protrader.org/ptmc-api/netscript/historicaldata/volume
And you can do something like:
sizeCoeff = (DisplayInLots) ? CurrentData.Instrument.LotSize : 1;
tickCoeff = Math.Pow(10, CurrentData.Instrument.Precision);
tick = CurrentData.Instrument.TickSize * tickCoeff;
double bidResult = Math.Floor(price * tickCoeff / tick) * tick;
double askResult = Math.Ceiling(price * tickCoeff / tick) * tick;
double volumeResult = CurrentData.Volume()/sizeCoeff;
Join PTMC community to post your replies on forum