MACD-Strategy M1 SP500

Forums ProRealTime English forum ProOrder support MACD-Strategy M1 SP500

Viewing 15 posts - 1 through 15 (of 19 total)
  • #211370

    Hello folks,
    here is my very simple strategy on SP500 (spread 0.4). Long has been consistently working well for months, so I disabled short. I found the settings around September 2022, so I can say that the strategy has been working in the raw version for at least the last year. The main trend is none other than the MA20 from the TF M15. The MACD entries work in reverse, so the bot enters each mini-pullback and tries to make a profit. The tandem filter works as a trend filter, although it should be used with caution. Can easily be over-optimized. The strategy is also only positive with a MA20 filter and a very low drawdown. The TP/SL ratio is 1:1.1 and I’ve kept it that way since last year. The only thing I tweak from time to time is really the tandem filter.


    @PeterSt
    Can you try it on PRT-IB how the curve looks there?
    I would appreciate opinions and suggestions for improvement (perhaps a better filter?).

    Sorry, I can’t see the “Insert code” option.

     

    //SP500 Spread 0.4

    DEFPARAM CUMULATEORDERS = false
    defparam preloadbars = 10000

    //Risk Management
    PositionSize = 5

    //Hauptfilter M15 10…50

    Timeframe(15minute, updateonclose)
    //Trend
    M15L1 = close > Average[20,0](close) and Average[20,0](close) > Average[20,0](close)[1]
    M15S1 = close < Average[20,0](close) and Average[20,0](close) < Average[20,0](close)[1]
    //Tandem
    M15L2 = Average[30,1](close) > Average[55,1](close)
    M15S2 = Average[20,1](close) < Average[50,1](close)

    Timeframe(default)

    //Trigger
    MACDLinie = MACDline[12,26,9](close) > 0
    MACDCross = MACD[12,26,9](close) crosses over 0

    MACDLinieshort = MACDline[12,26,9](close) < 0
    MACDCrossshort = MACD[12,26,9](close) crosses under 0

    TrendL = M15L1 and M15L2
    TrendS = M15S1 and M15S2

    long = MACDLinie and MACDCrossshort and TrendL

    short = MACDLinieshort and MACDCross and TrendS

    // trading window
    ONCE BuyTime = 153000
    ONCE SellTime = 210000

    // position management
    IF Time >= BuyTime AND Time <= SellTime THEN

    If long Then //not onmarket and
    buy PositionSize CONTRACTS AT MARKET
    SET STOP pLOSS hl
    SET TARGET pPROFIT hl*p

    ENDIF

    //If short Then //not onmarket and
    //sellshort PositionSize CONTRACTS AT MARKET
    //SET STOP pLOSS hs
    //SET TARGET pPROFIT hs*p2
    //
    //ENDIF

    endif

    if time >= 220000 then
    sell at market
    exitshort at market
    endif
    if time >= 215900 and dayofweek=5 then
    sell at market
    exitshort at market
    endif

     

     

    #211373

    First IG (below). What can I be doing wrong ?
    TF is 1 minute. Nasdaq 1 euro. 200K bars. I did not change any parameter nor anything in the code. Spread is 0.4 per your own setting. Tick by Tick is on.

    #211375

    The system is SP500 my dear. Spread 0.4. The joke is I couldn’t find a setting for Nasdaq with this functionality.

    #211377

    Hi,

    I’ve just downloaded this system.

    I’m running it in demo on SP500. I’m working to let it work also on short position and it seems it positively works.

    I’ve changed your original SL and TP ’cause it could do better than 10 pips. I’ve also modified the timeframes: 30M instead of 15 for short position, I’ve added a 3M timeframe for the trigger and left 1M as default.

    It seems to work quite well

    #211380

    Bzzzp

    We had this issue before that I can’t find the SP500 you are using. The smallest is $50 and that leads to 341000 profit; you would not want that.

    What you see below is from IB and I think this is the contract amount you are using (see 2nd attachment). Please let me know.

    I added a fee of 1,34 per order (this is 1,34 for in and another 1,34 for out). I can’t see the spread currently, but I think it is 0.5 (I sustained the 0.4).

    #211383
    JS

    Peter, I think you use two contracts with a value of 5 dollars per point, to compare you must use 1 contract with a value of 5 dollars per point…

    #211384

    OK, thanks.

    This is with one contract.

    #211386

    OK danke.

    Dies ist mit einem Vertrag.

    PRT-IB?

    #211387

    Hallo,

    Ich habe gerade dieses System heruntergeladen.

    Ich lasse es in der Demo auf SP500 laufen. Ich arbeite daran, es auch auf Short-Positionen funktionieren zu lassen, und es scheint, dass es positiv funktioniert.

    Ich habe Ihr ursprüngliches SL und TP geändert, weil es besser als 10 Pips sein könnte. Ich habe auch die Zeitrahmen geändert: 30M statt 15 für Short-Positionen, ich habe einen 3M-Zeitrahmen für den Trigger hinzugefügt und 1M als Standard belassen.

    Es scheint ganz gut zu funktionieren

    Could you post your code?

    #211388

    Yes, I’ll do but after my tests

     

    #211389

    Phoentzs, you did not ask for it, but in the first screenshot you see the mouse at the bottom on ~ half September 2022. It is where the zero line is (1M bars were used here).

    The second screenshot shows where you would have started backtesting. This is where the deepest dip is. Thus, quite over-optimized, I’d day.
    Of course with this I am referring to my other post from this morning. And Yes, I know that you like to regularly re-optimize, so no problem. The fun is that you can see by this that indeed it is over-optimized. I use this to test myself (did I really not over-optimize too much ?). It requires one thing only : never optimize over that spare bars available (200K bars back up to 1M back).

    #211393

    Please test over 1 million bars without the tandem filter. Just comment out “M15L2″… I would be interested.

    #211397

    Here you are.
    Logging off now for today.

    #211400

    In this TF you just have to optimize it regularly. You can’t get around it.

    #211401

    Which TF are you referring to ? 15 minutes or 1 minute ?
    I use both in the one strategy and I never ever – even want to – change it. That put differently : in my view it is not the way to re-optimize such (entry-dependent) things. But I already told : you think differently here and that is fine.

Viewing 15 posts - 1 through 15 (of 19 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login