Skip next trade – TrendFollowing

Forums ProRealTime English forum ProOrder support Skip next trade – TrendFollowing

Viewing 12 posts - 1 through 12 (of 12 total)
  • #26447

    Hello All!

    I was wondering if you could help me. I would like to add a bit of code into my trend following system that skips the next trade if the previous trade were profitable.

    The idea being that on trend following systems, periods of whipsawing often follow trending markets.

    Anyone familiar with the turtle system should be aware of the above concept.

    I’ve tried using positionperfp[1] but can’t figure out how to proceed.

    Any help is appreciated. Thanks

    #26460

    Hello trendfollower86,

    you can find a snippet below that shows an example of how the positionperf can be used to manage future orders.

     

     

    1 user thanked author for this post.
    #26487

    Thanks very much for your reply Derek.

    I understand the code above, however the problem I have is that the code above will not only skip the next trade, but all other trades following a winner.

    I imagine I need to put some kind of count function in the code so it counts to a maximum of 1 when a trade is skipped and then takes the next trade when reset.

     

    #26517

    I’m finding this thread interesting as it touches upon coding that would be really useful –

    How do you register “signals” but not trade them and instead just “count” each signal and then code to trade the 5th signal for example.

    This would be useful for counter trend signals such as the RSI where we know that the first, second and third can be misses but the fourth or fifth

    brings home the bacon.

    #26520
    #26531

    Ok. I have something like the following:

     

    But annoyingly, this doesn’t take any trades because SkipTrade never gets set to 1

    #26567

    The problem with all trades being skipped is probably caused by

    You can graph your Positionperformance when running a backtest to have the values for your system returned with the backtest results. Then you can enter the value you need (because honestly I don’t know what 0.01 is referring to).

    Simply remove the sample code from above and add this line to your backtest:

     

    #26568

    Hello Bighug,

    maybe like this?

     

     

    1 user thanked author for this post.
    #26569

    @trendfollower

    Your code is wrong. If you refer to previous Derek’s post, you already have the needed code to achieve your request = no more trade if the previous one is a profit > 0

    About your code, line 2, condition should be placed in parenthesis, and periods in brackets, you have apparently done a mistake while copy/paste code from another topic.

     

    #26584

    There is also mistake in my code:

    This should work.

    #26585

    @Nicolas.

    I’m not trying to achieve no more trades as you state. I am trying to skip the next trade if its previous trade was a winner. Then take the next trade regardless.


    @Derek
    , not sure where your reference to ” if perf” has come from. I don’t have that in my code. If you are referring to

    IF positionperf(1) > 0.01 then". I am trying to say, if the last postion closed out and returned any kind of profit skip the next trade. 

    #26591

    @Derek. Much appreciated. I have had some luck with this code:

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

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