Hi – I’m new to PRT and the forum – so I hope someone can help clarify things for me:
I wish to set the contract size by using the following formula:
Contracts = (0.002 x Equity) / (ATR[100] x PointValue)
lotsize = (0.002 * 10000) / ((AverageTrueRange[100](close)) * Pointvalue)
(I know that you can’t call equity – that is fine).
The problem is that I get some weird results in backtesting & I think it’s due to the contracts. However, I am not sure if it’s to do with the base currency needing converting or PointValue being incorrect. How can I get a print to output on PRT & where would I find that?
I wish to trade on many different types of markets.
Any advice gratefully received.
David
Hi David, if you wish to print out information on ProBacktest, you can use the GRAPH instruction : http://www.prorealcode.com/documentation/graph/
I also made a short blog article on this, here : http://www.prorealcode.com/blog/debugging-probuilder-graph-instruction/
You’ll find it easy now to debug your code in ProBacktest, hopefully. 🙂
Thank you so much Nicolas. That really is useful.
I wonder if you can help with the code of another money management technique? I am looking to code the turtles risk management model.
How would I standardise the dollar per point code on a range of markets to risk 1% on each trade for a range of markets using this formula:
Units = 1% Account Value / ATR x Dollars per Point
Here is my first attempt
SLbuy = (TRADEPRICE(1) - (AverageTrueRange[20](close)))
lotsizebuy = (0.01 * 10000) / (((AverageTrueRange[20](close)) * (SLbuy)) )
You want to risk 1% of what? Of your account balance? = 10.000GBP in your example?
Yes that’s right £10000 in the example is the account balance…
(It should be £ not dollars in the formula Units = 1% Account Value / ATR x £ per Point)
So the question is how do you get £ per point?
You can get the value of a point with : POINTVALUE
Value in €/$ of one pip (or one point) in the currency of the instrument. PipValue=PointValue.