Replies: 1 comment 1 reply
-
Can you show some code? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It happens on rare cases, that in my strategy exit condition is also met on same bar on which I have taken entry. I was looking for a way to tell the system to not close a position on the bar it takes entry on, it should at least wait till closing of subsequent bar to decide if position need be closed or not? For example
Scenario: In my strategy, I short when previous candle close go below 50EMA and cover when price close above 50EMA. It can happen previous candle happened below 50EMA. So I create a short position on opening of current candle, but with strong momentum price breaches 50EMA and close above it in same candle I had shorted.
What is happening: Short is closed on opening of subsequent candle since exit condition was met in previous candle.
What I want: Exit condition should only be checked on subsequent candle and not the candle on which entry was made
Can anyone advice how can I code above condition. Basically I need to tweak exit condition so it does not evaluate bar on which entry was made. Only from next candle onward it should do that.
Beta Was this translation helpful? Give feedback.
All reactions