I have situation were
On, session.islastbar_regular,
I have added,
strategy.entry(id = 'Long', direction = strategy.long, stop = today_low)
Assuming the stop value is 320, The trade is not executing if the next day opens at 321.
I tried to change to
strategy.entry(id = 'Long', direction = strategy.long, stop = today_low, limit= 400)
Still it is not executing.
If the next day opens at 319 and it crosses over 320 it works.
Looks like the pine script backtester engine has an issue if there is a gap in the next day open. Do you know any workaround?
strate execution when next day open at 321
I have situation were
On, session.islastbar_regular,
I have added,
strategy.entry(id = 'Long', direction = strategy.long, stop = today_low)
Assuming the stop value is 320, The trade is not executing if the next day opens at 321.
I tried to change to
strategy.entry(id = 'Long', direction = strategy.long, stop = today_low, limit= 400)
Still it is not executing.
If the next day opens at 319 and it crosses over 320 it works.
Looks like the pine script backtester engine has an issue if there is a gap in the next day open. Do you know any workaround?
strate execution when next day open at 321
Share Improve this question asked Jan 17 at 17:51 jerin jacobjerin jacob 12 Answers
Reset to default 0Try strategy.exit
if strategy.position_size > 0
strategy.exit(
id = 'Long Exit',
from_entry = 'Long',
stop = today_low,
limit = 400)
One it is executed then only exit make sense. Right? This is the case where the entry is not happening due to gap
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745350833a4623820.html
评论列表(0条)