Hi guys,
I want to share one of my DAX trading ideas based on cross over/under yesterdays high and low in combination with volatile intraday trading windows and certain week days. The approach is very simple works without indicators but seems to be very robust and reliable.
I have inserted Adolfo’s litle beauty concerning money management but fixed position size is possible as well (simply remove the comment).
Comments and improvements are welcome.
have fun
Reiner
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
// Lift up and down DAX 5M // Code-Parameter DEFPARAM FlatAfter = 113000 // trading window ONCE BuyTime = 84500 ONCE SellTime = 113000 // money management // variable position size - thanks Adolfo :-) ONCE Capital = 10000 ONCE Risk = 0.01 ONCE StopLoss = 10 ONCE equity = Capital + StrategyProfit ONCE maxrisk = round(equity*Risk) ONCE PositionSize = abs(round((maxrisk/StopLoss)/PointValue)*pipsize) // fixed position size // ONCE PositionSize = 10 // manage number of trades IF Time = BuyTime THEN LongTradeCounter = 0 ShortTradeCounter = 0 ENDIF // long on Monday until Thursday with filter close is above MA(14) and max 2 trades per day IF Not LongOnMarket AND Time >= BuyTime AND close CROSSES OVER DHigh(1) AND close > Average[14](close) AND LongTradeCounter < 2 AND CurrentDayOfWeek <> 5 THEN BUY PositionSize CONTRACT AT MARKET LongTradeCounter = LongTradeCounter + 1 sl = 50 tp = 130 ENDIF // short on Monday and Tuesday with filter close is under MA(9) and max 2 trades per day IF Not ShortOnMarket AND Time >= BuyTime AND close CROSSES UNDER DLow(1) AND close < Average[9](close) AND ShortTradeCounter < 2 AND CurrentDayOfWeek < 3 THEN SELLSHORT PositionSize CONTRACT AT MARKET ShortTradeCounter = ShortTradeCounter + 1 sl = 90 tp = 30 ENDIF // exit IF LongOnMarket AND Time = SellTime THEN SELL AT MARKET ENDIF IF ShortOnMarket AND Time = SellTime THEN EXITSHORT AT MARKET ENDIF // stop and target SET STOP pLOSS sl SET TARGET pPROFIT tp |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Hi Reiner, and thank you again for contribution. Your strategy embed some nice code and that’s why it’s always interesting to have this kind of contribution in the library!
Why does the takeprofit and stoploss have different values for buy/sell sides? I have changed the featured image of the strategy for everyone to see that everything were not so good before 2015, I think that it’s a bit overfit though.
Hi Nicolas,
Thanks for your comments. I appreciate your work very much – this kind of a PR platform I’ve missed for a long time :-).
Unfortunately backtesting is limited for me to the last 100.000 candles – do you know how to extend this as a IG customer?
In 2014 the DAX was a “lame duck” and breakout and trend strategies had there difficulties but at the end of the day this little beauty never had big drawdowns. I traded this strategy since last autumn only on the long side because of the good profit factor. Trading the short side with the same sl/tl is profitable as well but smaller profit rates shows better results.
best regards
Reiner
1 week into using Prorealtime and this ones is going to take me a little while to figure out what is happening. But in a one month back test yields a nice modest return doesn’t it. Really finding this website useful, thank to everyone who contributes.
Very interesting.This has defenitely given me many new idéas on how to code.Thanks!
Very interesting code.What a pity than we can’t backtest before 2014… A backtest on 10 years would be very reassuring.
I didn’t check the validity of the orders, buy this strategy seems very effective, thanks for sharing.
It also works in M15 timeframe. But with drawdown from May to October 2011.
The final performance with fixed position size on 8 years backtest is around the same as your test in M15.
It’s definitely seems to be profitable on real mode.
Thanks a lot for share, Reiner!
Andrés.
Hey Reiner,
Thank you for all your work here!
If you register at IG, it is possible to do it with a link of prorealtime. That way prorealtime will give you the professional version of the software, which includes more histoical data.
Is it ok to post the link here? If not, please delete it.
https://trading.prorealtime.com/de/brokerage/cfd-forex-trading
But I am note sure if it can be done afterwards.
Hi Reiner,
Thank you for this interesting code.
I like when the ratio is over 2!
And: Did you try an other indicator instead of moving average?
Thanks
Hi noisette,
I’ve only tried MA. Feel free to improve and let me know if you find a better approach.
What it makes profitable is to sort out the days with bad performance.
Regards
Reiner
very nice… in your opinion could it be curve fitted?
very nice… in your opinion could it be curve fitted?
those paramenters different for the short and long scares me a little. How did you chose them?
sl = 50tp = 130
sl = 90tp = 30
Why do you sell at 11.30? Is also that choosen on backtests?
curve fitted?
It’s curve fitted, sl/tp were the best values out from the historical backtests
11:30?
it’s my personal approach, usually I’m only trading from 9-11:00 – 11:30
Reiner… please open a thread on this. I would like to share some information with you. I’ve studied it a lot… The optimization you have done on which index has been done? Only DAX? And on which period?
I’ve changed your parameter curve fitted with ATR and tested it on other indexes. there could be a possibility to put this live but I need your help to understand something.
Yes, I’m trading only the DAX in 5 Minute chart and as IG customer for me are only the last 100.000 5 M candles available but this strategy should work on all indices as well.
I have modifed it a little… please go to here… http://www.prorealcode.com/topic/lift-up-and-down/#post-8604
Hi Reiner,
What is the max contracts when you running on Pro Order Trading? Mine having issue if I limit to 5 contracts and position size is 5.
I tried different sizes (3-10 DAX Minis) without problems
Thanks Reiner.
Then it’s really weird on today!!! Line28 auto Sell when Line 36 triggered without hitting SL / TP / Time Limit.
You can try to see today Equity Curve
Further explain, Line 36 forced to exit Line 28 Position (Long), and Immediately do a “Sell Short”.
On Monday yesterdays High/Low are from Sunday, a small range combined with low volatily triggered some loosers today, you understand it better, when you add some priceline indicator with High/Low from yesterday in the DAX chart
regards
Reiner
Thanks.
Could I have the pseudocode for this strat please?
Hi Real Pro,between 8:45 – 11:30 MEZ and every 5M candle check for a long trade if:– system is not long– close crosses over yesterdays high (please note this is the IG high and on Monday it’s the high of Sunday)– close ist greater then simple moving average[14]– number of long trades is less 3 trades per day– current day is not Fridaycheck for the short side– System is not short– close crosses under yesterdays low– close ist less then simple moving average[9]– number of short trades is less 3 (max 2 trades per day)– current day is Monday or TuesdayTrades will be closed:– at 11:30– system is long and the short conditions are true (close long and open short)– system is short and the long conditions are true (close short and open long)– stop or target levels will be achievedThat’s it, very simple.The general idea is to trade only on the first 2-3 trading hours, trade yesterdays high/low breakout with sl/tp and sortout the week days where this system is not profitable. This idea works more or less in every index with enough volatile.regardsReiner
Thanks for taking the time to do that Reiner. Much appreciated. I’ll try testing this on Amibroker platform.
I have copy/pasted your original formula into IG’s PRT backtester and it takes no trades. Not sure why. If you could suggest something that would be great.
I have tested it again and it worked as described. Maybe a problem with the timezone – all times are MEZ.
Hi Reiner,
I studied and tried this strategy on PRO demo account. I modified some parameter, Results seems reliable as backtest result. Trading performance seems not too bad except when some situations it caught by the New high / New low then U-Turn. This wil be painful. Is there any good indicator to prevent this ?
br,CKW
CKW, you mean oversold/overbought szenarios? Play around with an oscillator e.g. the wave trend oscillator, the code is available here in the library.
Yes. Something like that. I will try and pair with your strategy
Hi Reiner, can you build a system based on specification?
You can ask for free assistance on forums: http://www.prorealcode.com/forums/
or use the dedicated programming services: http://www.prorealcode.com/trading-programming-services/
Hi John,
Unfortunately I haven’t the time to offer the requested service but I’m sure you will find someone in the forum.
best, Reiner
Hello guys,
Thank you Reiner for your excellent work !
I put the code in real trades and until yesterday it took the trades. Did it happen to some of you ?
Best regards,
Roman