HELP! how to exit position if bar closes with profit?

Forums ProRealTime English forum ProOrder support HELP! how to exit position if bar closes with profit?

Viewing 4 posts - 1 through 4 (of 4 total)
  • #17231

    Coding help:

    As the topic said, how to write codes that will:
    exit a position (long or short) if current bar closes with profit? (any profit)

    and also how to:
    exit a position (long or short) after 5 bars.

    Many thanks!

    #17240

    This may get you started (0.0001 equates to 0.01%) …

    If Positionperf = – 0.0001 or Positionperf = 0.001 THEN

    Sell at market

    Exitshort at Market

    Endif

    If Barindex – Tradeindex = 5 Then

    Sell at market

    Exitshort at Market

    Endif

    Useful for you to check the instructions above on the ‘Function menu’ on the PRT Platform then you understand them better also you can check my syntax is correct! ha

     

    Cheers

    Graham

    PS Can you tell me why my posts are always double spaced?? 🙂

    #17241

    Aha I can see already! I use a lot of short sentences and hit return a lot!!!! lol
    I need to remember to shift+return instead!  It’s great asking questions cos it makes me look for answers!

     

    #17243

    Thank you so much!!

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

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