ramontillo
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: March 15th, 2023

Tp and SL problems

hi guys,

i have a problem with Tp and Sl:

they can shot only after the candle close, but i'd like they could shot considering just the price.

For example, if i set a TP to 2%, i see that, with strategy.close and also with strategy.exit, the tp condition is calculated only after the close of the last candle.

But i would that the position was closed as soon the TP (or SL) price is reached

Can you help me? Could you share a sample code to obtain what i need?
thank you very much!
my best
;)

Return to “Share Your Scripts”