http://www.stevehopwoodforex.com/phpBB3 ... ?f=15&t=79
is the very useful pipFactor code found in Lines 371 to 375.
Code: Select all
//Calculating the factor needed to turn pip values into their correct points value to accommodate different Digit size.
//Thanks to Lifesys for providing this code. Coders, you need to briefly turn of Wrap and turn on a mono-spaced font to view this properly and see how easy it is to make changes.
string pipFactor[] = {"JPY","XAG","SILVER","BRENT","WTI","XAU","GOLD","SP500","S&P","UK100","WS30","DAX30","DJ30","NAS100","CAC400"};
double pipFactors[] = { 100, 100, 100, 100, 100, 10, 10, 10, 10, 1, 1, 1, 1, 1, 1};
double factor;//For pips/points stuff. Set up in int init()Any assistance in this matter will be greatly appreciated.
A few days ago I sent a PM to Lifesys, and received a fairly detailed advise below, but because of my ignorance of the finer points of programming I cannot make any sense of it.
ZI honestly do not know. It is not always that simple, depending on the min. quantities per trade, numb significant digits etc. Pipfactor works well for currencies as we know significant digits but I never traded any of those commodities. Just open a small trade in each and see how such as iExposureTickets copes with your figures.