Forums ProRealTime English forum ProOrder support Stop / close Position on close bar or alert with trigger too close Reply To: Stop / close Position on close bar or alert with trigger too close

#113358

Roberto’s code does not allow for gaps between the close and the open of the next candle which is the price you will actually be buying at. This code does:

You have to be aware that by only closing a trade at the close of a candle (open of the next in reality) you are leaving yourself open to price blowing straight through your stop loss value and falling massively lower before you sell which could equal a very big loss compared to your stop loss value.