help with break-even code as a second position and second exit

Forums ProRealTime English forum ProOrder support help with break-even code as a second position and second exit

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

    Hello

    help with break-even code as a second position and second exit

    I have conditions to go long and conditions to go short and I have exit conditions which is a stop loss and take profit but what i would like to try and do, If the take profit is activated is to have a second contract (pound per point) which would have a break-even at entry and a second exit condition to specifically for the second contract (pound per point).   C3 and C6 Should be the exit for the second contract    I would like this to happen if the TP is hit not before

    I have seen and read (Breakeven code for your automated trading strategy) but I do not know how to implement it

    Hopefully I’ve explained it well enough 2 contracts one gets sold at a Take profit the second one is allowed to continue until the macd crosses or break even is hit

     

    #151943

    I think I posted this in the wrong place

    #151945

    i have been trying with the Breakeven code but i find it hard to do what i want,

     

    On the second position I would like it to exit with an indicator after Break even has been activated

    #151946

     

    #151949

    That one above is wrong sorry i’ve tried it this way it below but it’s still not right

     

    #151951

    i think iv got

     

    #151962

    Nope that’s not right either i’ll try again with just the break-even

    #151966

    I’ll try and explain what I’m doing better I want to buy or sell two lots or contracts or pounds per points,

    1. with a take profit condition for 1 lot      (AverageTrueRange[14](CLOSE))*1.5)
    2. with a stop loss condition  for 2 lots      (AverageTrueRange[14](CLOSE))*2)
    3. with a break-even condition  for 1 lot     after take profit is hit
    4. With a exit condition                                 to let the 2nd lot run for more profit

    Below is all the code that I have for this and is not in working condition I’ve

     

    just laid it out to make it simple

    #151970

    Giving it my best shot and I’m still falling short,
    I don’t know if it’s the break-even

     

    or all the take profit or the stop loss that’s causing the trade to end too soon

    #151973

    I’ve tried a more simpler system without the break-even i’m still having issues it turns out it’s the take profit that’s causing the issue I don’t know what to do from here

     

    #151974

    Yes, Take Profit is the issue, you forgot to add

    line 21 doesn’t make sense, you are making a logical comparison with TP which does not retain a logical value. Use the above line as line 29, instead.

     

     

    #151980

    but I only want it to sell half

     

    #151986

    Then change line line 21 to:

    but beware that your SL and TP changes every candle. I don’t know if that is what you want.

     

    #152011

    Is it at all possible to fix it to the candle that open the trade

    #152024

    Yes, you need to place their calculation within the conditions to enter a trade, along with the keyword NOT ONMARKET  to make sure they are not changed while the trade is open:

     

    1 user thanked author for this post.
Viewing 15 posts - 1 through 15 (of 39 total)

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