System being inconsistant
Forums › ProRealTime English forum › ProOrder support › System being inconsistant
- This topic has 8 replies, 2 voices, and was last updated 8 years ago by jbyrne.
-
-
07/04/2016 at 2:46 PM #10180
Hi, if re-written my system but it’s very inconsistent since the code seems to be fine but when I backtest it, it doesn’t always go long/short when its mean’t to please help. Please check links for photos of the problem I’m having.
Photo link: https://gyazo.com/e844d6b20ad1b5dbc3afc38d2d19ba4f
Also I’m using spreadbetting and all the units seems to be in cents in instead of full numbers, anyway to change that? thanks
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748// Definition of code parametersDEFPARAM CumulateOrders = false // Cumulating positions deactivated// Conditions to enter long positionsindicator1 = Average[9](close)c1 = (indicator1 CROSSES OVER open)indicator2 = Average[9](close)c2 = (indicator2 CROSSES UNDER close)IF c1 AND c2 THENBUY 3 PERPOINT AT MARKETENDIF// Conditions to exit long positionsindicator3 = Average[9](close)c3 = (indicator3 CROSSES UNDER open)indicator4 = Average[9](close)c4 = (indicator4 CROSSES OVER close)IF c3 AND c4 THENSELL AT MARKETENDIF// Conditions to enter short positionsindicator5 = Average[9](close)c5 = (indicator5 CROSSES UNDER open)indicator6 = Average[9](close)c6 = (indicator6 CROSSES OVER close)IF c5 AND c6 THENSELLSHORt 3 PERPOINT AT MARKETENDIF// Conditions to exit short positionsindicator7 = Average[9](close)c7 = (indicator7 CROSSES OVER close)indicator8 = Average[9](close)c8 = (indicator8 CROSSES UNDER close)IF c7 AND c8 THENEXITSHORT AT MARKETENDIF// Stops and targets07/04/2016 at 3:21 PM #10181You have some conditions that do not suit the crosses over/under at the same time, that’s why there are some problems obviously.
If you want to test a simple cross of the price with a moving average, you should only code it like this:
1234567indicator1 = Average[9](close)//buy conditioncBuy = (close CROSSES OVER indicator1)sell conditioncSell = (close CROSSES UNDER indicator1)That’s all you need.
07/04/2016 at 3:32 PM #10184Hi, thank you for your help it’s helped me a lot. I have realized that the problem i was having is that I use heiken ashi candles but ProOrder uses regular candlesticks. How can I get my code to buy/sell according to Heiken Ashi candles instead of regular candlesticks? thank you
07/04/2016 at 3:42 PM #1018607/04/2016 at 3:43 PM #1018707/04/2016 at 4:00 PM #1019007/04/2016 at 4:12 PM #1019107/04/2016 at 6:44 PM #1020007/04/2016 at 7:15 PM #10203 -
AuthorPosts
Find exclusive trading pro-tools on