Stop moved to entry when in profit

Forums ProRealTime English forum ProOrder support Stop moved to entry when in profit

Viewing 11 posts - 16 through 26 (of 26 total)
  • #75854

    I’ve tidied the post up – again! The ‘Insert PRT Code Button’ is not difficult to find or use! 🙂

    Screenshot_6-2

    #75868

    Please understand I have zero coding knowledge. Someone helped me put the algo together. They can’t help me get the stop to entry once in 25 points profit and adviced that I use this forum.

    I don’t know what breakevenflag means or how it works.

    #75876

    breakevenflag is just a variable used in this case as a switch . It is either on (=1) or off (=0). If you have reached your 25 pips then it is switched on and so the code knows now that we have achieved that goal. If we later sell then we switch it off so that the code can once again start looking to see when we have a new trade whether it has hit our desired 25 pips.

    #75877

    Thanks for the explanation. How does it set the stop to entry or zero points?

    #75878

    There was a typo in your last code and you had // an important part of the code. I tested this code and it does what you ask for.

     

    #75879

    Some explanation:

     

    #75887

    Correct me if I am wrong, but the breakeven rule is triggered with every candle closing. So if within a candle we have a spike in the desired direction nothing happens until candle close time is here, please confirm.

    #75889

    Yes, you’re right, and if the price retraces to a price lower than your treshold before closing, it eon’t Even trigger breakeven even if in profit.

    It can be modified so that it compares HIGH instead of CLOSE to your treshold.

    #75890

    Correct me if I am wrong, but the breakeven rule is triggered with every candle closing. So if within a candle we have a spike in the desired direction nothing happens until candle close time is here, please confirm.

    Yes but we can only make decisions at the candle close. If it goes 25 pips in profit and then falls back to 5 pips in loss then we have no chance to catch that get out at break even mid candle. Setting a stop loss at break even after a candle has closed just because at sometime during the candle it went above a 25 pip gain would most probably lock in more losses than break evens. We can only do what we can do at candle close and I think the OP was working on short time frames and on markets where 25 pips in a short amount of time is likely.

    #75892

    Thanks for all the help, I went to prepare the algo for automatic trading and got the following:

     

    The following changes must be applied before sending the code to ProOrder:

    Trading systems with orders that partially close a position cannot be sent to ProOrder (ex: sell 3 shares at market). Make sure that no quantity is specified in instructions to close positions (in this case the instruction closes the entire position). Ex: sell at market. Exitshort at 1.5 limit

     

    Please help?

    #75898

    Change the last four lines of code to this:

    Partial position closure is not allowed in ProOrder trading yet. Rumours are that it should be soon.

Viewing 11 posts - 16 through 26 (of 26 total)

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