Coding request for EMA9 / WMA30 strategy

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

Tagged: , , , , , ,

Viewing 5 posts - 1 through 5 (of 5 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.

     

     

    #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.

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

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