Coding request for EMA9 / WMA30 strategy

Forums ProRealTime English forum ProOrder support Coding request for EMA9 / WMA30 strategy

Tagged: , , , , , ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • #179990

    Hello, I have a coding request for the following strategy from Galen Woods. Can someone code that for me, please?

    These are the rules for a long trade signal:

    The 9-period EMA must be above the 30-period WMA

    The two moving averages must be separated from each other

    The first bar to close below the 9 EMA is used as the trigger bar for the buy setup

    Place a buy limit order above the high of the trigger bar.

    If you want to go short, follow this three step process:

    The 9-period EMA must be below the 30-period WMA

    The two moving averages must be separated from each other

    The first bar to close above the 9 EMA is used as the trigger bar for the sales setup

    Place a sell limit order below the low of the trigger bar

    Trailing stop loss below / above the WMA30

     

    For better reading of the trading rules I found this website:

    https://tradingstrategyguides.com/9-30-trading- strategy / # When_to_use_the_930_Trading_Method

    #180009

    There you go:

    I used the more conservative trailing stop based on WMA30, but I also commented out the more aggressive way. You can simply use either by swapping comment slashes (but I think it shouldn’t be rewarding).

    I tested it on DAX € 5, 1h TF, 200K units.

     

     

    3 users thanked author for this post.
    #180027

    Thank you very much Roberto, the strategy looks good. The way it should work. I think the results are better on Nasdaq or SP500.

    Can you please explain the function of lines 18 and 19 to me? In words?

    Can you add a take profit? In relation to the SL, 1: 1 or 1: 1.5?

    #180029

    That’s to make sure the two averages have some gap in between them. I use GAP (difference) to calculate their distance, then I set variable APART only when that gap is greater than the its average over a given period.

    Replace lines 27-37 by these ones (I couldn’t test them, though):

    replace 1.5 with any multiplier of your choice.

    #180035

    Thank you Roberto. I will test it in peace.

    #219959

    Hi Phoentz,

    Thanks for digging on other sites to get new ideas ^^

    did you get a good backtest on this one and on which asset ? Mine are negative before 2021 on NAS H1;

    best

    #219964

    The strategy is intended intraday… I got it to work quite adequately with changed values ​​in the TF M1 on Nasdaq. It’s been a while. But I had the feeling that it wasn’t stable. But I’m a little smarter now than I was then. It’s possible that I didn’t have much of a clue as to how the system worked.

    1 user thanked author for this post.
    #220435

    Ah ok I was updating the backtest of Roberto that was in “1 ora”

    https://www.prorealcode.com/topic/coding-request-for-ema9-wma30-strategy/#post-180009

    here is the backtest ;

    Maybe inverting the conditions can make it a winner 😉

    Thanks anyway,

    Chris

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

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