barssince #591
Unanswered
Hawar-Dzaee
asked this question in
Q&A
barssince
#591
Replies: 1 comment
-
so you would want to have a second flag that says how many times this entry_condition happened?
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How can I refer to a previous "barssince".
I know that "barssince" count the candles since the condition was "last time true.
I want to enter a buying order after there have been three consecutive green candles ( twice), as indicated below.
if I set
entry_condtion = barrsince( self.data.close[-1]>self.data.close[-2]>self.data.close[-3])
if entry_condition>0:
`self.buy()
it will open a position at the first instance. I want to open on the second instance.
so my strategy is to (this pattern happens twice) then open a position. and so on.
If this can not be done using "barssince" is there another way to do that??
is there "valuewhen"?
Beta Was this translation helpful? Give feedback.
All reactions