View Full Version : Round Numbers
Michael
16th July 2003, 12:14 PM
Using an ATR value for calculating an entry or exit, of course results in fractions of a cent, all listed in the database. Particularly if using say H+0.5*ATR (or even less), which has more significance for higher prices. Is there a method for the calculations to be based on the nearest whole number, that is the nearest cent up or down? With large trade sizes tested over long time periods these discrepancies are bound to be accumulating and giving me false results.
David Samborsky
17th July 2003, 01:47 PM
Hello Michael
Currently TradeSim does not doing any rounding however you could try the following in your Metastock code.
myvar:=H+0.5*ATR();
myvar:=int(100*myvar)/100;
Michael
23rd July 2003, 11:19 AM
I've tried this David, but without any success. I put it just above the ExtFml codes - would this be correct, or should it be somewhere else?
Thanks for your help.
David Samborsky
23rd July 2003, 12:06 PM
Hello Michael,
It sounds like you have placed it in the right order.
Could you please post your formula here so I could verify what you have written.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.