Up Down Range Trading on Daily Charts SA 40
Forums › ProRealTime English forum › ProOrder support › Up Down Range Trading on Daily Charts SA 40
- This topic has 9 replies, 4 voices, and was last updated 7 years ago by Vincenzo2017.
-
-
06/17/2016 at 4:05 PM #9518
Hey Guys / Girls
I have been playing around with a trading system based on range (High – Low) based on the SA 40 index (as I am South African I wanted to trade what I know).
The trading strategy is simple.
A Buy Stop is placed at 10% of “Yesterday’s” range above “Yesterday’s” high.
A Sellshort Stop is also placed at 10% of “Yesterday’s” range below “Yesterday’s” low.
The reason I placed Yesterday in quotations is that PRT evaluates the code at the end of each bar. Thus to determine “Yesterday’s” range we have to evaluate today’s Highs and Lows and place stop orders which activate at the start of the next Bar.
I have also added a trailing stop loss. The results look good, however I am a bit worried that PRT paints a rosy picture due to the backtest being on a Daily timeframe. It may be that in real time trading, the trailing stop loss causes the system to stop out prior the point indicated in the backtest.
I haven’t had a look at Backtesting on the DAX or FTSE just yet and will look into that in the next few weeks.
Opinions and comments are welcome.
123456789101112131415161718192021222324252627282930313233343536373839//-------------------------------------------------------------------------// Main code : UP DOWN Range(R10 Micro)(1d)//-------------------------------------------------------------------------DEFPARAM CUMULATEORDERS = false//SET VARIABLESSTARTDAY = 1 //ONLY TRADE MONDAY TO FRIDAYENDDAY = 5NoContracts = 2 //START WITH 2 NUMBER CONTRACTSMAXLOSS = 75 //MAXIMUM POINT LOSSUPM = 0.1 //MULTIPLIER TO RANGE FOR LIMIT ORDERSDNM = 0.1 //MULTIPLIER TO RANGE FOR LIMIT ORDERS//SET LEVEL FOR LIMIT ORDERSIF DAYOFWEEK > STARTDAY AND DAYOFWEEK <= ENDDAY THEN //ON DAYS THAT ARE NOT MONDAYPREVRANGE = HIGH-LOWLIMITPRICE = MAX(OPEN,CLOSE) + (UPM*PREVRANGE)SHORTPRICE = MIN(OPEN,CLOSE) - (DNM*PREVRANGE)UPTREND = CLOSE > OPEN //DETERMINE IF IN AN UPTRENDDNTREND = CLOSE < OPEN //DETERMINE IF IN AN DOWNTRENDELSIF DAYOFWEEK = STARTDAY THEN //ON MONDAY LOOK AT FRIDAYPREVRANGEMON = HIGH[1]-LOW[1]LIMITPRICE = MAX(OPEN[1],CLOSE[1]) + (UPM*PREVRANGEMON)SHORTPRICE = MIN(OPEN[1],CLOSE[1]) - (DNM*PREVRANGEMON)UPTREND = CLOSE[1] > OPEN[1] //DETERMINE IF IN AN UPTRENDDNTREND = CLOSE[1] < OPEN[1] //DETERMINE IF IN AN DOWNTRENDENDIF//ENTERING TRADESIF DAYOFWEEK >= STARTDAY AND DAYOFWEEK <=ENDDAY THEN//SET ORDER FOR LONG POSITIONSIF NOT LONGONMARKET AND UPTREND THENBUY NOCONTRACTS CONTRACTS AT LIMITPRICE STOPENDIF//SET ORDER FOR SHORT POSITIONSIF NOT SHORTONMARKET AND DNTREND THENSELLSHORT NOCONTRACTS CONTRACTS AT SHORTPRICE STOPENDIF// STOPS AND TARGETSSET STOP $TRAILING (NoCONTRACTS*MAXLOSS*POINTVALUE)//SET TARGET PPROFIT 7*MAXLOSSENDIF1 user thanked author for this post.
06/17/2016 at 4:13 PM #9521Hello,
Thanks a lot for sharing your trading strategy on our site. I have moved your post from Library to the forum instead, because unfortunately, you were right, the backtest paint a “rosy” picture of what would happen really, because of the trailing stop.
ProBacktest don’t know when your trailing stop triggered inside candlesticks, so the best favourable condition is taken. This is something that will be changed in the next major update of the platform = ProBacktest will be more accurate with what would happen in real time.
Don’t hesitate to share other ideas or ask questions 🙂
03/27/2017 at 7:17 PM #30049Hi CarelDavis and Nicolas,
thank you for your contribution!
Do you have some update on this strategy? Now PRT take in consideration the trailing stop loss as in reality? Or there is a way to avoid this “bug” ?
I tested on various index and on various period and always receive a huge profit. Do you think that in reality there will be too much difference from the backtest?
(I mean if current backtest give me +1000 %, how much would be in reality?)
Thank you in advance
03/27/2017 at 7:34 PM #3005104/04/2017 at 8:47 AM #30955Hey Vincenzo2017
I have not had a look at this Strat in the ProRealTime 10.3 software. I have been busy setting up some currency strats. I will backtest it and let you know. I agree with Eric that the return seems unbelievable. I will run a live test on my demo account as Suggested for a month and let you know what I come up with.
04/04/2017 at 8:48 AM #30956Thanks Eric I will Backtest for a month on live demo account and then we should see if it is truely working.
04/04/2017 at 9:15 AM #3096404/04/2017 at 9:45 AM #30968Hey Nicolas
At that stage I didn’t backtest with a spread. Yes the spread on the SA40 can be high sometimes more than 15. I did backtest in PRT 10.3 with a realistic spread and in tickmode and the results look vastly different. Nowhere near the returns shown above and in fact seems to drain the account. PRT also states that it doesn’t have tick data for all the bars. Even if I only backtest between the last 100 000 ticks on the daily chart. (I have attached the screen grab showing their error screen). Maybe there is still some work for the PRT team. I will still run the live test so will report back
04/04/2017 at 1:35 PM #30998Tick backtest is the only way to backtest to get a result near to what you could expect in a real live trading environment. That’s what I pointed to you in my last year post:
ProBacktest don’t know when your trailing stop triggered inside candlesticks, so the best favourable condition is taken. This is something that will be changed in the next major update of the platform = ProBacktest will be more accurate with what would happen in real time.
Full history in ticks are not available for all instruments and that seems to be the case for South Africa 40.
04/04/2017 at 6:37 PM #31026Hello everybody, thank you for your suggestion and special thanks Nicolas for your patience! 🙂
Now I found your previous post about this subject and also wathced your video on youtube.
We hope that finally those backtest in tick by tick mode, will give a result close much as possible to reality.
Thanks!
-
AuthorPosts
Find exclusive trading pro-tools on