Probably pretty simple answer, but I am trying to set my limit order to execute something like this
if ta.barssince(enterLong) < 3
strategy.entry(id="EL", direction=strategy.long, limit=low[1] * -0.01)
i'm not sure how to write the arithmetic for this. Goal is to create a limit order based on prev candle trigger but to calculate limit by a negative in order to create a lower limit based on a percentage, so in this case, create limit entry at -1% from previous candle low.
Isn't -1% in your logic is 99% of the whole value?
if ta.barssince(enterLong) < 3
strategy.entry(id="EL", direction=strategy.long, limit=low[1] * 0.99)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.