3-10 Oscillator Swing Trading System

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #210706 quote
    Jeki20
    Participant
    New

    Good morning

    I would like to create this Backtesting on this Swing strategy:

    Long Entry Rules:

    ADX>30

    +DMI> -DMI

    the 3-10 oscillator must have at least 5 consecutive bearish days (the 3-10 oscillator is a difference between the 3-period simple moving average and the 10-period simple moving average)

    If the market closes above the open, buy long on the close.

    Exit rules:

    Exit on the close after 3 to 7 bars.

    Can you help me develop it?

    Thank you

    #210713 quote
    robertogozzi
    Moderator
    Master

    Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums

    Thanks 🙂

    Jeki20 thanked this post
    #210790 quote
    robertogozzi
    Moderator
    Master

    You also used the wrong support forum, for strategies the correct one is the ProOrder support forum. I moved it.

    There you go:

    DEFPARAM CumulateOrders = False
    myADX   = adx[14] > 30
    myDMI   = DIplus[14](close) > DIminus[14](close)
    Sma3    = average[3,0](close)
    Sma10   = average[10,0](close)
    ind310  = Sma3 - Sma10
    Bearish = (summation[5](ind310 < 0) = 5)
    IF myADX AND myDMI AND Bearish AND Not OnMarket AND (close > open) THEN
       BUY 1 CONTRACT AT MARKET
    ENDIF
    IF LongOnMarket AND ((BarIndex - TradeIndex) >= 3) THEN   //exit after 3 bars  (change it to any positive value
       SELL AT MARKET
    ENDIF
    #210799 quote
    Jeki20
    Participant
    New

    Thanks a lot for your support and quick reply….sorry next time I will use the right support forum.

    Stefano

    robertogozzi thanked this post
    #211045 quote
    Jeki20
    Participant
    New

    Hello I don't get this rule 'Bearish = ( summation [ 5 ] (ind310 < 0 ) = 5 )' The rule is that the oscillator 3-10 must have 5 consecutive days 'down' for example (I modified ADX >25) . Jan 5 should have given me an entry signal: day 1 = 25 day 2 = 17 day 3 = 15 day 4 = 7 day 5 = -13 from the formula instead it doesn't give me any signal. See attachment Thank you

    Esempio_OSS-buy.pdf
    #211090 quote
    robertogozzi
    Moderator
    Master

    Only post in the language of the forum that you are posting in. For example English only in the English speaking forums and French only in the French speaking forums. I translated it using the translator, which doesn’t keep the original format.

    As to attached pics, image formats (mainly JPG, JPEG and PNG) are a better choice. PDF files should be used mainly for formatted documents.

    Thank you 🙂

    Anyway

    Bearish = ( summation [ 5 ] (ind310 < 0 ) = 5 )

    means that there must be 5 consecutive bars where the indicator 3-10 is below 0, i.e. in a bearish position as you asked (Sma3 below Sma10).

    Do you want to modify the conditions?

    #211096 quote
    Jeki20
    Participant
    New

    Sorry… and Thanks

    I didn’t want to change the rules, the rule is at least “5 consecutive down days“, maybe I didn’t clear mention before. I think that this doesn’t mean <0.

    As per attached example the condition for buy it was manually/visually checked on 5 Gen 2000, but the system given me a buy signal.

    I’ would like to understand the reason, maybe the indicator 3-10 is not below 0, but 5 consecutive down day of the 3-10 max or closing day?

    Appreciated your support.

    Thanks

    Stefano

    #211103 quote
    robertogozzi
    Moderator
    Master

    Please post the  instrument, timeframe, date & time of an incorrect trade opened, so I can better check.

    #211110 quote
    Jeki20
    Participant
    New

    Here below the requested infromations:

    Instrument: Future CME e-mini S&P500 ticker ‘MESXXXX

    Timeframe: Daily

    Date: Dec. 28th 1999, ADX(14) = 26, 74 5 (S&P futures are not in a downtrend, +DI>-DI).

    The 3-10 oscillator drops for at least 5 consecutive days (Dec.28th 1999 = 3-10 Osc. = 26,97, Dec.29th =22,06, Dec.30th =17,59, Dec.31st =15,11, Jan.3rd=7,45, Jan4th= – 13,25).

    The S&P futures on Jan 5th close above its open. (close=1213,11, open=1211,61)

    An Oscillator Swing System buy signal should also triggered on the close of Jan.5th 2000

    Thanks

    #211131 quote
    robertogozzi
    Moderator
    Master

    In both dates ADX < 30, how can a BUY be triggered?

    Pic1.jpg Pic1.jpg Pic2.jpg Pic2.jpg
    #211151 quote
    Jeki20
    Participant
    New

    Sorry

    As I said above, I changed the ADX>30 into ADX>25 and also I take out the condition +DMI>-DMI, no buy signal was given.

    DEFPARAM CumulateOrders = False
    myADX   = adx[14] > 25
    //myDMI   = DIplus[14](close) > DIminus[14](close)
    Sma3    = average[3,0](close)
    Sma10   = average[10,0](close)
    ind310  = Sma3 Sma10
    Bearish = (summation[5](ind310 < 0) = 5)
    IF myADX AND Bearish AND Not OnMarket AND (close > open) THEN
       BUY 1 CONTRACT AT MARKET
    ENDIF
    IF LongOnMarket AND ((BarIndex TradeIndex) >= 3) THEN   //exit after 3 bars  (change it to any positive value
       SELL AT MARKET
    ENDIF
    I think that there is something in the condition ‘Bearish = (summation[5](ind310 < 0) = 5)’ because ind310 to be down for 5 days and not less than zero.
    I will continue in searching…thanks.
    #211152 quote
    fifi743
    Participant
    Master

    works on the nasdaq M15

    #211153 quote
    JS
    Participant
    Senior

    I think you can use this for Bearish:

    Bearish = Summation[5](ind310 < ind310[1]) = 5

    #211174 quote
    Jeki20
    Participant
    New
    Thanks a lot …it seems that is working. …appreciate your support and your patient… Stefano
    JS thanked this post
    #211195 quote
    robertogozzi
    Moderator
    Master
    @Jeki20 In your first post asked “the 3-10 oscillator must have at least 5 consecutive bearish days (the 3-10 oscillator is a difference between the 3-period simple moving average and the 10-period simple moving average)“. To accopmplish that a negative difference is what you need, unless you changed your mind in the meantime. A single average less than the previous one doesn’t imply a downtrend.
Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.

3-10 Oscillator Swing Trading System


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Jeki20 @jeki20 Participant
Summary

This topic contains 16 replies,
has 4 voices, and was last updated by JS
2 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/01/2023
Status: Active
Attachments: 3 files
Logo Logo
Loading...