Using MA to trigger a trailing stop

Forums ProRealTime English forum ProOrder support Using MA to trigger a trailing stop

Viewing 10 posts - 1 through 10 (of 10 total)
  • #150043

    Is there any reason the following shouldn’t work with a moving average value (or any other defined indicator) as the trigger for a trailing stop?

    Seems to work as expected in initial tests (where HULLa is defined further up the page)

     

    2 users thanked author for this post.
    #150045

    Because at line 23 and the others you make a difference with inverted operators, write it as above.

     

    #150046

    Do you mean that line 23 should be

    isn’t that effectively the same as line 35 for short positions?

    1 user thanked author for this post.
    #150050

    Yes, in line 23 and the other ones those two operators need to be swapped.

    #150051

    Like so?

    or

     

     

     

    #150055

    Yes, but I did not spot it before, you have to also replace TRADEPRICE(1)  with CLOSE.

     

    #150056

    This is the original Nicolas’code and the modified version for you:

    the opposite for Short trades.

    1 user thanked author for this post.
    #150057

    Roberto, the original TS that I had been using was like this:

    Then without changing anything else, I exchanged ‘close’ for ‘typicalprice’. This also works fine, but then I thought, why have the TS triggered by the performance of just one candle? why not use an MA value?

    It is precisely the use of ‘close’ that I am trying to get away from.

    I don’t understand why ‘close’ shouldn’t simply be replaced by ‘HULLa’ as in my first post.

    #150078

    Tradeprice(1) needs to be replaced by HULLa.

    If profitable CLOSE needs to be above the MA for Long trades and below for Short trades.

     

    1 user thanked author for this post.
    #150079

    Ok, I’ll try that, thanks!

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

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