Moving average cross over on multiple timeframes, 1-3 risk reward

Forums ProRealTime English forum ProOrder support Moving average cross over on multiple timeframes, 1-3 risk reward

Viewing 7 posts - 1 through 7 (of 7 total)
  • #175094

    Hello i am new on here and have a moving average strategy i wish to put into an automated trading bot. It marrys up data on multiple timeframes.

    Im a trader rather than programmer so i need help to do this, although i need to understand the programming side so i can play around with parameters.

    The basic structure of the strategy is price to be above or below an SMA on the 4 hour and day timeframe and trade to be taken on a crossoveer of an SMA

    on a 15 min timeframe. with a 1-3 risk reward ratio and a trailing stop loss.

    I also want a condition on there where if the trigger candle is of a certaine (adjustable) size the trade will trigger on a pullback to 50% of this candle body

    Could somebody please advise on how and where to start with this? I am also in the process of reading the manual but unfortunately still cant work out

    where to start and the basic structure of how the programming should go.

    Thanks,

    Joe

    1 user thanked author for this post.
    #175147

    There you go:

     

    #175160

    I forgot to add the trailing stop:

     

    #175358

    Hi thankyou for your quick response. This was the basic idea if my strategy,
    I have taken the basic structure of what you posted to adapt to my full strategy
    but it did not end up working, there are also a few faults with it i have
    tried a few different things to get it working but have typed it out below so you can
    see what i’m going for.

    DEFPARAM CumulateOrders = false
    Timeframe(Daily,UpdateOnClose)
    sma501d = Average[50](close)
    //
    sma901d = Average[90](close)
    //
    sma2001d = Average[200](close)
    //
    Timeframe(4h,UpdateOnClose)
    sma504h = Average[50](close)
    //
    sma904h = Average[90](close)
    //
    sma2004h = Average[200](close)
    //
    Timeframe(15 Minute,UpdateOnClose)
    sma5015m = Average[50](close)
    //
    sma9015m = Average[90](close)
    //
    sma20015m = Average[200]
    //
    ema3415m = ExponentialAverage[33](close)
    //
    ema5515m = ExponentialAverage[55](close)
    //
    Timeframe(default)
    L1 = sma501d > sma901d //I would like to adjust the distances between the moving averages in pips
    S1 = sma501d < sma901d L2 = sma901d > sma2001d
    S2 = sma901d < sma2001d L3 = sma504h > sma904h
    S3 = sma504h < sma904h L4 = sma904h > sma2004h
    S4 = sma904h < sma2004h L5 = sma5015m > sma9015m
    S5 = sma5015m < sma9015m L6 = sma9015m > sma20015m
    S6 = sma9015m < sma20015m L7 = close > sma501d
    S7 = close < sma501d L8 = close > sma901d
    S8 = close < sma901d L9 = close > sma2001d
    S9 = close < sma2001d L10 = close > sma504h
    S10 = close < sma504h L11 = close > sma904h
    S11 = close < sma904h L12 = close > sma2004h
    S12 = close < sma2004h L13 = close > sma9015m
    S13 = close < sma9015m L14 = close > sma20015m
    S14 = close < sma20015m L15 = close CROSSES OVER ema3415m and ema5515m and sma5015m [Crosses over all in same candle] // I need the trigger candle to have met this criteria within the close of candle on default timeframe S15 = close CROSSES UNDER ema3415m and ema5515m and sma5015m [Crosses over all in same candle] // I need the trigger candle to have met this criteria within the close of candle on default timeframe CondL = L1 and L2 and L3 and L4 and L5 and L6 and L7 and L8 and L9 and L10 and L11 and L12 and L13 and L14 and L15 Not CondS = S1 and S2 and S3 and S4 and S5 and S6 and S7 and S8 and S9 and S10 and S11 and S12 and S13 and S14 and S15 Not If CondL and condM THEN BUY 1 Contract AT Market Elsif CondS and CondT THEN SELLSHORT 1 Contract AT Market ENDIF set stop pLoss 10 set target pProfit 30 The strategy goes as follows: 1 day timeframe: 50 sma > 90sma
    90 sma > 200sma
    close > 50sma
    close > 90sma
    close > 200sma

    4 hour timeframe:
    50 sma > 90sma
    90 sma > 200sma
    close > 50sma
    close > 90sma
    close > 200sma

    15 min timeframe

    50 sma > 90sma
    90 sma > 200sma
    close crosses over ema3415m and 5515m and sma5015m (crosses all within same candle on closing basis)

    Buy 1-3 risk reward.

    1 day timeframe:
    50 sma < 90sma 90 sma < 200sma close < 50sma close < 90sma close < 200sma 4 hour timeframe: 50 sma < 90sma 90 sma < 200sma close < 50sma close < 90sma close < 200sma 15 min timeframe 50 sma < 90sma 90 sma < 200sma close crosses under ema3415m and 5515m and sma5015m (crosses all within same candle on closing basis) sell risk reward 1-3 I also need a condition putting on there where that if the signal candle exceeds 15 pips, the bot will only take a trade if the price retraces to 50% of this candle on the next candle only. Thankyou for your help kind regards

    #175359

    I apologize for the messy visual, i am new to this i tried to line this up as you would see it on the coding page
    please let me know if you have any questions regarding it. Thank you

    #175389

    I have attempted to order the programming i have for clearer reading. I hope this works

    Then the condition  where if the trigger candle exceeds 15 pips (an adjustable value)

    the bot will take a trade if the price pulls back to 50% or more of the next candle Only.

     

    Thank you for your support

     

    #175394

    here is a clear description of the strategy in case above isn’t clear

    1 day timeframe:

    50 sma > 90sma
    90 sma > 200sma
    close > 50sma
    close > 90sma
    close > 200sma

    4 hour timeframe:
    50 sma > 90sma
    90 sma > 200sma
    close > 50sma
    close > 90sma
    close > 200sma

    15 min timeframe

    50 sma > 90sma
    90 sma > 200sma
    close crosses over ema3415m and 5515m and sma5015m (crosses all within same candle on closing basis)

    Buy 1-3 risk reward.

     

    and the opposite for a sell.

     

     

Viewing 7 posts - 1 through 7 (of 7 total)

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