Take profit last low / last swing

Viewing 15 posts - 16 through 30 (of 50 total)
  • Author
    Posts
  • #183552 quote
    phoentzs
    Participant
    Master

    I can try. I’m just guessing the signal would come too early.

    #183555 quote
    JS
    Participant
    Senior

    A very useful fast MA is the Hull MA…

    Midlanddave thanked this post
    #183670 quote
    phoentzs
    Participant
    Master

    For the time being I decided for a simple MACD pullback. I already use this system to success in the M1 time frame. I have simplified it something and transformed to 10 seconds. It is important to know, I like to use standard parameters. Simply here SMA20 and SMA200 and MACD. I have added an ADX in standard size. So should not be over-optimized. If one takes TP / SL away, it is also positive. Unfortunately, I can only for 7 days, but that does not even look so bad.

    German time
    SP500
    Spread = 0.6
    TF 10Seconds

    What do you think? Does anyone have 1000000 bars for testing?

    @Grahal @nonethleess: What does the expert eye say?

    //================================================
    
    DEFPARAM CUMULATEORDERS = false
    defparam preloadbars = 10000
    
    
    //Risk Management
    PositionSize=5
    
    timeframe(1minute, updateonclose)
    
    MAM51 = Average[20,0](close)
    MAM52 = Average[200,0](close)
    mylongM5   = MAM51 > MAM52
    myshortM5 =  MAM51 < MAM52
    
    myADX = ADX[14] > 20
    
    timeframe(default)
    
    MAM1 = Average[1,0](close)
    mylongM1orig  = MAM1 > Average[200,0](close)
    myshortM1orig  = MAM1 < Average[200,0](close)
    
    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
    
    
    // trading window
    ONCE BuyTime  = 120000   //080000
    ONCE SellTime = 210000
     
    // position management
    IF Time >= BuyTime AND Time <= SellTime THEN
    
    If MACDCross and MACDLinieshort and mylongM1orig and mylongM5 and myADX Then  //and myADX
    Buy PositionSize CONTRACTS AT MARKET
    SET STOP %LOSS 0.5
    SET TARGET %PROFIT 0.8
    
    ENDIF
    
    If MACDCrossshort and MACDLinie and myshortM1orig and myshortM5 and myADX Then  //and myADX
    sellshort PositionSize CONTRACTS AT MARKET
    SET STOP %LOSS 0.5
    SET TARGET %PROFIT 0.8
    
    ENDIF
    
    endif
    
    if longonmarket and myshortM5 then
    sell at market
    endif
    if shortonmarket and mylongM5 then
    exitshort at market
    endif
    
    Midlanddave thanked this post
    #183678 quote
    nonetheless
    Participant
    Master

    here’s the 1m bar BT in UK open hours (143000 – 210000), spread = 0.4

    At a quick glance, i’d say this line looks wrong:

     

    MAM1 = Average[1,0](close)

    SMA with a period of 1 … is that what you wanted?

    phoentzs thanked this post
    #183681 quote
    phoentzs
    Participant
    Master

    Can you please test again over the same time and comment on SL and TP before?
    SMA with 1 period is the same as “Close”.

    #183682 quote
    nonetheless
    Participant
    Master

    please test again over the same time

    i did that already, it’s a bust – loss of e700 in 6 months. It at least turns a profit in open hours but needs more work.

    #183683 quote
    phoentzs
    Participant
    Master

    Damned. It would have been too easy.

    #183684 quote
    phoentzs
    Participant
    Master

    Would this variant be better? My short back test period says SP500, NASDAQ and DAX positive results. Can you check that again?
    Run either for 10 seconds or 30 seconds.

    //================================================
    
    DEFPARAM CUMULATEORDERS = false
    defparam preloadbars = 10000
    
    
    //Risk Management
    PositionSize=5
    
    ////myATR = AverageTrueRange[14](close)
    
    timeframe(1minute, updateonclose)
    
    MAM51 = Average[20,0](close)
    MAM52 = Average[200,0](close)
    mylongM5   = MAM51 > MAM52
    myshortM5 =  MAM51 < MAM52
    
    timeframe(default)
    
    MAM11 = Average[20,0](close)
    MAM12 = Average[200,0](close)
    mylongM1orig   = MAM11 crosses under MAM12
    myshortM1orig  = MAM11 crosses over MAM12
    
    
    // trading window
    ONCE BuyTime  = 120000   //080000
    ONCE SellTime = 210000
     
    // position management
    IF Time >= BuyTime AND Time <= SellTime THEN
    
    If mylongM1orig and mylongM5 Then  //and mylongM5
    Buy PositionSize CONTRACTS AT MARKET
    //SET STOP %LOSS hl //0.8
    //SET TARGET %PROFIT gl //1
    
    ENDIF
    
    If myshortM1orig and myshortM5 Then  //and mylongM5
    sellshort PositionSize CONTRACTS AT MARKET
    //SET STOP %LOSS hs //0.8
    //SET TARGET %PROFIT gs //1
    
    ENDIF
    
    endif
    
    if longonmarket and myshortM5 then  //or myshortM1orig
    sell at market
    endif
    if shortonmarket and mylongM5 then  //or mylongM1orig
    exitshort at market
    endif
    #183685 quote
    nonetheless
    Participant
    Master

    sorry but it only gets worse, 10s or 30s

    If you’ve only got 200k to play with I think it’s better to stay with TFs that give you a decent amount of data, 5min and above

    #183687 quote
    GraHal
    Participant
    Master

    I’m putting this ever so slightly forked version (TP & SL only) on Forward Test today!

    DAX 3 sec spread = 1

    Keep ’em coming  phoentzs , thank you for sharing!

    #183701 quote
    phoentzs
    Participant
    Master

    @Grahal: Will you tell me which version or post the code?

    #183718 quote
    phoentzs
    Participant
    Master

    When I think about it … does it make sense to optimize over 1000000bars in such a short time frame? The basic message that your test shows is that the system has been positive for half a year. And that the system had major problems in November and earned nothing for a month. So November market conditions are not a good fit for this system. Since this system lives from longer, short-term daily trends, despite the short time frame, the problem could perhaps be remedied with a trailing stop. And as luck would have it, one is already running in my demo … I’ll post the results tomorrow morning.

    #183722 quote
    PeterSt
    Participant
    Master

    (maybe this post is not much useful)

    When I think about it … does it make sense to optimize over 1000000bars in such a short time frame?

    But of course it does (I wish I had 10M bars for my s1 TF). And maybe this even especially applies to the shorter TimeFrames; the more situations you run into (with good overall result) the better it is – it shows you the resilience of your system. So maybe it is not about optimizing as such but merely about checking what happens underway – you actually tell the same ?

     

    The basic message that your test shows is that the system has been positive for half a year. And that the system had major problems in November and earned nothing for a month. So November market conditions are not a good fit for this system.

    If November market conditions are not good for your system, you may be broke with it started on November 1 by accident. This is how I declare “resilience”. It should cover for all and be independent of marker conditions. This is how the system becomes a “technical” thing (I think you will recall that I name my systems “technical” as such).

    With the (way) longer TimeFrames, you will make yourself dependent on market conditions you don’t even know yet. Thus, supposed your system makes profit only when it runs for two years, how will you ever be able to deal with the drawdowns ? If you money-wise can, you still can’t psychologically. This may work for Stocks, but not for what most are attempting (Futures). At least that is how I think it is. 😉
    Below you see my DAX (manual trading). This is for a reason. Why would my autotrading be longer term ? Hence, how to – at times – perform several trades per hour (most out of defense) if the TF is H1 or even more ?

    #183725 quote
    phoentzs
    Participant
    Master

    I cannot say exactly why I am suddenly building a system in the range of seconds … more normally I take signals from the H4 chart and evaluate them in the M1 … M15. Well, exactly this system works for me in the M1 with amazing results. Quite stable in several indices. I have been handling this system manually in the S10 or M1 for a few weeks in order to discover errors. I’ve usually always been a breakout trader, but it seems to me that pullbacks are even better for me. And this type of system is nothing else. You never stop learning in your life. For years I have tried to develop systems in the forex market with rather modest success. If I had concentrated more on indices.

    #183726 quote
    nonetheless
    Participant
    Master

    If you money-wise can, you still can’t psychologically

    This aspect is absolutely crucial when looking at historical performance; how would you feel watching it haemorrhage money for 8 consecutive weeks? You don’t know at that point that when December comes you’ll make it all back, all you see is that you’re bleeding money and you probably stop the system to cut your losses. I know I would.

    Personally, I’ve been burned too often trying to work micro TFs ( < 1m )  that I don’t bother with them any more. The likelihood of a curve fit is too high. I’ve never seen one that worked consistently (although maybe Grahal knows the secret 😉)

Viewing 15 posts - 16 through 30 (of 50 total)
  • You must be logged in to reply to this topic.

Take profit last low / last swing


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
phoentzs @phoentzs Participant
Summary

This topic contains 49 replies,
has 7 voices, and was last updated by phoentzs
4 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/17/2021
Status: Active
Attachments: 20 files
Logo Logo
Loading...