Trading the 5 Min Bar

Viewing 15 posts - 46 through 60 (of 67 total)
  • Author
    Posts
  • #58580 quote
    GraHal
    Participant
    Master

    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).

    #58584 quote
    Vonasi
    Moderator
    Master

    I’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?

    #58587 quote
    robertogozzi
    Moderator
    Master

    Topic move to ProOrder support as correctly requested by @GraHal.

    Due to the “divide by zero” issues I quit testing it.

    #58631 quote
    GraHal
    Participant
    Master

    Damn 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! 🙂

    #58633 quote
    GraHal
    Participant
    Master

    Vonasi 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!! 🙂

    #58653 quote
    Vonasi
    Moderator
    Master

    Vonasi 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.

    GraHal thanked this post
    #62970 quote
    GraHal
    Participant
    Master

    Due 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

    //-------------------------------------------------------------------------
    // Main code : $ RGozzi Macd-Mfi DAX 5M
    //-------------------------------------------------------------------------
    //-------------------------------------------------------------------------
    // Main code : RGozzi Macd-Mfi DAX 5M
    //-------------------------------------------------------------------------
    //-------------------------------------------------------------------------
    //                             Macd-Mfi DAX 5 min
    //-------------------------------------------------------------------------
    DEFPARAM CumulateOrders     = False
    DEFPARAM FlatBefore         = 080000//090000                      //no trades before 09:00:00
    DEFPARAM FlatAfter          = 210000//213000                      //no trades after  21:30:00
     
    ONCE nLots                  = 1                        //number of LOTs traded
     
    ONCE TP                     = 25                         //60    pips Take Profit
    ONCE SL                     = 40                          //40    pips Stop Loss
    
    ONCE Macd1                  = 14                          //14
    ONCE Macd2                  = 32                          //32
    ONCE Macd3                  = 9                           //9
    MacdVal                     = MACD[Macd1,Macd2,Macd3](close)
    MacdSignal                  = MACDline[Macd1,Macd2,Macd3](close)
    
    MfiVal                      = MoneyFlow[23](close)        //23
    //***************************************************************************************
    IF LongOnMarket THEN
    IF MacdSignal CROSSES UNDER MacdVal THEN
    SELL AT MARKET                                      //Exit LONGs when MACD reverses southwards
    ENDIF
    ENDIF
    IF ShortOnMarket THEN
    IF MacdSignal CROSSES OVER MacdVal THEN
    EXITSHORT AT MARKET                                 //Exit SHORTs when MACD reverses northwards
    ENDIF
    ENDIF
    //***************************************************************************************
    trailingstart = 6      //2     trailing will start @trailinstart points profit
    trailingstep  = 6      //8     trailing step to move the "stoploss"
    //reset the stoploss value
    IF NOT ONMARKET THEN
    newSL=0
    ENDIF
    //manage long positions
    IF LONGONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND close-tradeprice(1)>=trailingstart*pipsize THEN
    newSL = tradeprice(1)+trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
    newSL = newSL+trailingstep*pipsize
    ENDIF
    ENDIF
    //manage short positions
    IF SHORTONMARKET THEN
    //first move (breakeven)
    IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THEN
    newSL = tradeprice(1)-trailingstep*pipsize
    ENDIF
    //next moves
    IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
    newSL = newSL-trailingstep*pipsize
    ENDIF
    ENDIF
    //stop order to exit the positions
    IF newSL>0 THEN
    SELL AT newSL STOP
    EXITSHORT AT newSL STOP
    ENDIF
    //***************************************************************************************
    //                                       LONG trades
    //***************************************************************************************
    a1 = close > open                                         //BULLish bar
    a2 = MacdSignal CROSSES OVER MacdVal                      //MACD goes North
    a3 = (MfiVal > 500) AND (MfiVal > MfiVal[1])             //3200 Mfi limit
    IF a1 AND a2 AND a3 THEN
    BUY nLots CONTRACT AT MARKET
    ENDIF
    //***************************************************************************************
    //                                      SHORT trades
    //***************************************************************************************
    b1 = close < open                                         //BEARish bar
    b2 = MacdSignal CROSSES UNDER MacdVal                     //MACD goes South
    b3 = (MfiVal < - 500) AND (MfiVal < MfiVal[1])            //-3200 Mfi limit
    IF b1 AND b2 AND b3 THEN
    SELLSHORT nLots CONTRACT AT MARKET
    ENDIF
    //
    SET TARGET PPROFIT TP
    SET STOP PLOSS     SL
    //GRAPH MfiVal AS "Mfi"
    
    Roberto-6.jpg Roberto-6.jpg Roberto-7.jpg Roberto-7.jpg
    #63004 quote
    GraHal
    Participant
    Master

    The 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

    Nicolas thanked this post
    Roberto-8.jpg Roberto-8.jpg
    #63011 quote
    Gertrade
    Participant
    Veteran

    Hi everybody,

    I allowed myself to revisit the 3 strategies with a TF 28 sec.
    This helps to reduce space time and get results faster.

    Below are the 3 strategies:

    GraHal thanked this post
    Tema-Stoc-Rsi-DAX-28-sec-v1.0.itf Macd-Mfi-DAX-28-sec-v1.0.itf Klinger-Rvi-Lsma-DAX28sec-v1.0.itf
    #63024 quote
    GraHal
    Participant
    Master

    @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
    GraHal

    #63027 quote
    Gertrade
    Participant
    Veteran

    @ Grahal,

    Your questions are always very relevant. I like that. I will study this question. Instinctively, I will say that Backtests on 1mn and 5mn must be bad.

    See you later.

    GraHal thanked this post
    #63028 quote
    GraHal
    Participant
    Master

    Hey 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.

    ONCE TP                     = 5                          //23    pips Take Profit
    ONCE SL                     = 15
    Gertrade thanked this post
    Gert-16.jpg Gert-16.jpg Gert-17.jpg Gert-17.jpg
    #63031 quote
    GraHal
    Participant
    Master

    Note 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?

    Gertrade thanked this post
    Gert-18.jpg Gert-18.jpg
    #63047 quote
    Aloysius
    Participant
    Veteran

    Hi 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…

    #63051 quote
    GraHal
    Participant
    Master

    @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.

Viewing 15 posts - 46 through 60 (of 67 total)
  • You must be logged in to reply to this topic.

Trading the 5 Min Bar


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 66 replies,
has 8 voices, and was last updated by Gertrade
7 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/13/2017
Status: Active
Attachments: 38 files
Logo Logo
Loading...