No immediately stop starting Trailing Stop code

Forums ProRealTime English forum ProOrder support No immediately stop starting Trailing Stop code

Viewing 3 posts - 1 through 3 (of 3 total)
  • #184458

    Hi all,

    I recently start with coding and I learned a lot with reading the articles on this forum and the code I found.

    Now I’m working on the Trailing Stop code which I found on in this forum. The code is working (backtesting + Paper Trading) but I have a question:

    When the trade starts, the ‘ stop’  is not immediately  active, but after the entry candle has been closed and the conditions has been met, then the Trailing Stop will be active.

    This means that I have a risk because when I enter my trade, there is no stop…….is that correct assumption? Or do I use the Trailing Stop code incorrect?

    But when I enter a trade, I want to have immediately a stop to avoid the risk, how do I program that in the code?

    Can you help?

    Below a code (simple sample code) with the Trailing Stop which is working in Backtesting + Papertrading:

    ——————————————————————————————————————————

     

    ——————————————————————————————————————–

     

    Thanks in advance!

    Richard

    #184461

    Just add a SET STOP PLOSS just below, or before, SET TARGET PPROFIT, so you’ll have a stop loss from the very start.

     

     

    #184542

    Hi Roberto,

    It is working, thanks!

     

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

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