Trading the 5 Min Bar
Forums › ProRealTime English forum › ProOrder support › Trading the 5 Min Bar
- This topic has 66 replies, 8 voices, and was last updated 6 years ago by Gertrade.
-
-
01/09/2018 at 12:32 PM #58580
Just checked and there is no entry in the Orders List under Rejected / Cancelled??
I’ve started Strat running again and I’ll see if it trades during DAX volume available periods (as Nicolas suggested lack of volume might be the reason re the divide by zero error).
01/09/2018 at 12:54 PM #58584I’m ‘licking my wounds’ at the mo as I got on the wrong side of the DAX rout today and I let it run thinking the price drop would pull back! Cheers GraHal
Yes we are bouncing around a supply and demand zone that was evident back around 7th/8th Nov and just above one from 18th/19th Dec. A dangerous place to take a position as could go either way from here. Best to wait for a breakout and jump on once it is established.
Now how exactly do you code that is the big question?
01/09/2018 at 1:05 PM #58587Topic move to ProOrder support as correctly requested by @GraHal.
Due to the “divide by zero” issues I quit testing it.
01/09/2018 at 3:23 PM #58631Damn shame that Roberto as you put a lot of good effort into that Strat.
We need to bottom out the divide by zero error; Ill keep trying stuff and let you know, but as you are loads better than me so don’t hold your breath! 🙂
01/09/2018 at 3:29 PM #5863301/09/2018 at 3:48 PM #58653Vonasi that was July I wrote … I’m ‘licking my wounds’ at the mo Today has been one of my best days for quite a while … so far!!
Ooops my bad. Should check the post dates before posting.
Yes today is a better day for going long than the range bound trading yesterday – but not as good as last week. If only everyday was as good as last week on the DAX? We are still within the 7th/8th Nov supply and demand zone and that big number 13400 is causing some difficulty to get over.
1 user thanked author for this post.
02/17/2018 at 1:19 PM #62970Due to having had a ‘bashing’ of late with my manual trading, I’m going over old Algos.
@robertogozzi helped me loads and did some super coding below so all credit goes to Roberto.
With two variable value changes, the original code now gives good results on a 1 Hour TF.
Can’t get trades beyond 10,000 bars … is that normal?? It’s on my Demo Platform, but no error messages.
GraHal
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192//-------------------------------------------------------------------------// Main code : $ RGozzi Macd-Mfi DAX 5M//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Main code : RGozzi Macd-Mfi DAX 5M//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Macd-Mfi DAX 5 min//-------------------------------------------------------------------------DEFPARAM CumulateOrders = FalseDEFPARAM FlatBefore = 080000//090000 //no trades before 09:00:00DEFPARAM FlatAfter = 210000//213000 //no trades after 21:30:00ONCE nLots = 1 //number of LOTs tradedONCE TP = 25 //60 pips Take ProfitONCE SL = 40 //40 pips Stop LossONCE Macd1 = 14 //14ONCE Macd2 = 32 //32ONCE Macd3 = 9 //9MacdVal = MACD[Macd1,Macd2,Macd3](close)MacdSignal = MACDline[Macd1,Macd2,Macd3](close)MfiVal = MoneyFlow[23](close) //23//***************************************************************************************IF LongOnMarket THENIF MacdSignal CROSSES UNDER MacdVal THENSELL AT MARKET //Exit LONGs when MACD reverses southwardsENDIFENDIFIF ShortOnMarket THENIF MacdSignal CROSSES OVER MacdVal THENEXITSHORT AT MARKET //Exit SHORTs when MACD reverses northwardsENDIFENDIF//***************************************************************************************trailingstart = 6 //2 trailing will start @trailinstart points profittrailingstep = 6 //8 trailing step to move the "stoploss"//reset the stoploss valueIF NOT ONMARKET THENnewSL=0ENDIF//manage long positionsIF LONGONMARKET THEN//first move (breakeven)IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THENnewSL = tradeprice(1)+trailingstep*pipsizeENDIF//next movesIF newSL>0 AND close-newSL>=trailingstep*pipsize THENnewSL = newSL+trailingstep*pipsizeENDIFENDIF//manage short positionsIF SHORTONMARKET THEN//first move (breakeven)IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THENnewSL = tradeprice(1)-trailingstep*pipsizeENDIF//next movesIF newSL>0 AND newSL-close>=trailingstep*pipsize THENnewSL = newSL-trailingstep*pipsizeENDIFENDIF//stop order to exit the positionsIF newSL>0 THENSELL AT newSL STOPEXITSHORT AT newSL STOPENDIF//***************************************************************************************// LONG trades//***************************************************************************************a1 = close > open //BULLish bara2 = MacdSignal CROSSES OVER MacdVal //MACD goes Northa3 = (MfiVal > 500) AND (MfiVal > MfiVal[1]) //3200 Mfi limitIF a1 AND a2 AND a3 THENBUY nLots CONTRACT AT MARKETENDIF//***************************************************************************************// SHORT trades//***************************************************************************************b1 = close < open //BEARish barb2 = MacdSignal CROSSES UNDER MacdVal //MACD goes Southb3 = (MfiVal < - 500) AND (MfiVal < MfiVal[1]) //-3200 Mfi limitIF b1 AND b2 AND b3 THENSELLSHORT nLots CONTRACT AT MARKETENDIF//SET TARGET PPROFIT TPSET STOP PLOSS SL//GRAPH MfiVal AS "Mfi"02/17/2018 at 9:18 PM #63004The above code uses / needs volume figures.
Hey I think I might have thought of an answer to my question above re no trades beyond 10,000 bars … when did IG start providing volume figures … 10,000 x 1H bars ago??
Also the divide by zero error (see previous posts) may be caused by lack of volume during out of hours periods? Nicolas did suggest this a while back.
GraHal
PS Yep that’s it … see attached
1 user thanked author for this post.
02/18/2018 at 6:44 AM #6301102/18/2018 at 11:38 AM #63024@Gertrade what do results for your 3 Strats look like on 5 Min TF?
Do you not think results would be more consistent on 5 Min or even 1 Min … as that is what loads of traders use and so we can jump on the bandwagon of success! 😉
Thanks
GraHal02/18/2018 at 12:09 PM #6302702/18/2018 at 12:22 PM #63028Hey wow … must be loads of potential in these!!!!!
All I did was change below and look at results of 5 Min TF!!!!!!Loving the staircase curve!!!!!!!!!!!!!!!!!!
Look at the 89% winning Trades!!!!!!!!!!! Look at the £5 Drawdown?????????????
Quick In and Out, money back in my pot and sleep soundly!!!!!!!!!!!!!!!!! 🙂 🙂 🙂
Onward and Upward eh Gertrade?
GraHal
PS If consistent returns over a long period then all we have to do to make big money is to increase Lot Size.12ONCE TP = 5 //23 pips Take ProfitONCE SL = 151 user thanked author for this post.
02/18/2018 at 12:34 PM #63031Note that I didn’t pick the best overall result.
I selected a compromise between best % winning trades, number of Trades, profit and tick mode value etc (=1)
GraHal
PS Hope above fires you up to consider normal accepted Time Frames … 15Min, 5 Min, 1Min etc?1 user thanked author for this post.
02/18/2018 at 4:17 PM #63047Hi Grahal and Gertrade,
When I backtest as Grahal in 5 mn TF with 200 000 bars the Gertrade’s Klinger, the strategy has always big losses, except the very short period you tested, since some weeks: but when you have only 9 positions, the backtest, optimised, has no signification. So Gertrade proposition in 28s TF is almost the same: very short backtest for a few days, optimised for a dozen of positions: unfortunatly it is not very reliable. Anyway live trading will tell us. And thanks for these searches! I am searching too, but I find nothing…
02/18/2018 at 6:41 PM #63051@Aloysius I agree, I only did it quick as I was going out and I was trying to get Gertrade fired up on the 5 min TF 🙂
Did you try optimising and Walk Forward over your 200,000 bars? It would be good if you could please as a lot / most of us can’t even get 200,000 bars.
We’d love to see optimised results if you could please Aloysius ?
I’m also intrigued … what are you searching for? 🙂
GraHal
PS we owe a big thank you to @robertogozzi as he coded the Algos on this Thread … Klinger, Tema and MACD-Mfi.I’m sorry this thread was abandoned for quite some time, but it’s good we have ‘fresh blood’ on it now.
I hope Roberto comes back also … his coding is so well laid out, easy to read and lines are commented so we can see what the code is doing etc.
-
AuthorPosts
Find exclusive trading pro-tools on