Help With ATR settings in code

Forums ProRealTime English forum ProOrder support Help With ATR settings in code

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

    Hi! Can anybody help my understand why my system gets stopped when a order is opened? The system says the stop loss i set to far away from the price and then the position is closed and the system stopped. Im not sure why the system just don’t set the stop acccording to the ATR stetting. I run it on a demo account on IG.

    This is my code:

     

    #222054

    Hi,

    at first glance you used a stop instruction expecting a distance in points from the position price, but instead of using it with a distance, you used it with a price level (which would be a much bigger number and explain the message too far away from price). So, either you may replace your lowest[3](low)-1.75*atrvalue with the distance from position price, or you may use a different stop instruction expecting a price level (set stop price).

    https://www.prorealcode.com/documentation/ploss-2/

    https://www.prorealcode.com/documentation/price/

    1 user thanked author for this post.
    #222056

    As Noobywan explained, you should use SET STOP PRICE, which is used to set a stoploss at a specific price.

    Also, you set the target profit in points with a value in price, you should use SET TARGET PROFIT instead (which is used to set a target in price distance unit).

     

    1 user thanked author for this post.
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