Only one trade/trend

Forums ProRealTime English forum ProOrder support Only one trade/trend

Tagged: 

Viewing 15 posts - 1 through 15 (of 15 total)
  • #159504

    How can i limit the code to only do one trade per trend? Lets say im following supertrend and after take profit or loss i want to stay flat till next direction on supertrend.

    BR. Lasse

    #159506

    To take an order only when the Supertrend turn from green to red or red to green, use that code snippet:

     

    1 user thanked author for this post.
    #159509

    I moved the topic from ProBuilder to ProOrder support, as it deals with a strategy.

    Please make sure you have carefully read the rules highlighted below (in yellow) in order to correctly use this forum. Thank you 🙂

     

    1 user thanked author for this post.
    #159515

    Hi Nicolas

    I attach the code for better understanding. For an example i want to the sell 25-jan 11:00 then take profit 13:37. Then i want the system to stay flat til 25-jan 22:10 when the upptrend starts and after stopploss 26-jan 02:25 stay flat again til next downtrend.
    I only want one trade per trend (trend =30min supertrend 3:10)

    Open itf in 1minute 5k units and Wall street cash.

    Many Thanks.

     

    #159518

    This is what the code I prodived is doing 🙂

    Please copy/paste your code and by using the ‘insert prt code’ button. Better than attaching the itf file, thank you.

    #159519

     

     

    #159521

    You need to set a flag every time you send an entry order to market and not reset that flag until the trend changes direction. The flag not being set is a condition for allowing entry.

    1 user thanked author for this post.
    #159524

     

    sounds right, but i don’t know how to do it. flag?

    #159536

    flag = just a variable that you set to 1 or 0. If it is 1 then you have already opened a trade. If it is zero then no trade has been opened since the last change in supertrend direction. I don’t have time to amend your code for you right now.

    #159537

     

    OK please help me when you have time.
    Thanks.

    #159541

    Something like this (not tested and coded after a couple of glasses of wine!):

     

    1 user thanked author for this post.
    #159591

     

    Something is wrong in line 11, im not able to fix it 🙂

     

    #159652

    Try this:

     

    1 user thanked author for this post.
    #160539

    Hi Robertogozzi

     

    Can you help me fix a flag or trade limiter i the code, i only want one trade /supertrend timeframe ( 30min)

     

    #160549

    Try this (not tested):

     

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

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