Reiner

Lift up and down DAX 5M

Category: Strategies By: Reiner Created: May 25, 2016, 4:19 PM
May 25, 2016, 4:19 PM
Strategies
35 Comments
Lift up and down DAX 5M

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

// 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

 

Download
Filename: Lift-up-and-down-DAX-5M.itf
Downloads: 642
Download
Filename: lift-up-and-down-dax-1464100457l84cp.png
Downloads: 220
Reiner
Reiner Veteran
I usually let my code do the talking, which explains why my bio is as empty as a newly created file. Bio to be initialized...
Author’s Profile

Comments

RomanK_actor
10 years ago
#

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

John Ufuoma
10 years ago
#

Hi Reiner, can you build a system based on specification?

Reiner
10 years ago
#

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

Nicolas
10 years ago
#

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/

CKW
CKW
10 years ago
#

Yes. Something like that. I will try and pair with your strategy 

CKW
CKW
10 years ago
#

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

 

Reiner
10 years ago
#

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.

Real Pro
10 years ago
#

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.

Reiner
10 years ago
#

I have tested it again and it worked as described. Maybe a problem with the timezone - all times are MEZ.

Real Pro
10 years ago
#

Could I have the pseudocode for this strat please?

Reiner
10 years ago
#

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 Friday

check 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 Tuesday

Trades 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 achieved

That'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 sort
out the week days where this system is not profitable. This idea works more or less in every index with enough volatile.

regards
Reiner

CKW
CKW
10 years ago
#

Thanks. 

CKW
CKW
10 years ago
#

Further explain, Line 36 forced to exit Line 28 Position (Long), and Immediately do a "Sell Short".

Reiner
10 years ago
#

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

CKW
CKW
10 years ago
#

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

CKW
CKW
10 years ago
#

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.

Reiner
10 years ago
#

I tried different sizes (3-10 DAX Minis) without problems

Anonymous
10 years ago
#

I have modifed it a little... please go to here... http://www.prorealcode.com/topic/lift-up-and-down/#post-8604

Anonymous
10 years ago
#

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.

 

Reiner
10 years ago
#

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.

Anonymous
10 years ago
#

Why do you sell at 11.30? Is also that choosen on backtests?

 

Reiner
10 years ago
#

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

Anonymous
10 years ago
#

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 = 50
tp = 130

sl = 90
tp = 30

 

Anonymous
10 years ago
#

very nice... in your opinion could it be curve fitted?

noisette
10 years ago
#

And: Did you try an other indicator instead of moving average?

Thanks

Reiner
10 years ago
#

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

noisette
10 years ago
#

Hi Reiner,

Thank you for this interesting code.

I like when the ratio is over 2!

flowsen123
10 years ago
#

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.

Andres
10 years ago
#

It's definitely seems to be profitable on real mode.

Thanks a lot for share, Reiner!

Andrés.

Doctrading
10 years ago
#

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.

ProRealCode ProRealCode
Loading...