You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Love this program! I'm very new (as my question will substantiate),please forgive me if the answer is glaringly obvious:
I was writing my own indicators in order to help me understand the program and came across something I perceived to be odd.
When I have a few indicators (self.I) I noticed that the first trade will not happen until the indicator with the largest length as been met, even if that indicator is not used as a condition to open or close a trade. In my case I have the following indicators and their lengths; sma/14, rsi/14,ema/50 and ema/200.
If I run with all indicators active (not commented out) the first trade will not happen until the 200th bar, with ema/200 deactive first trade happens at the 63rd bar, and if the ema 50 and ema200 indicators are both deactivated then the first trade happens correctly at the 29th bar. Why do the ema indicators affect when the first trade happens, even when they are not a condition of the trade?
Clear as mud I'm sure , so I hope some code and output snippets will help.
`
self.overbought = crossover(70,self.pine_rsi)
if self.position and self.overbought:
self.position.close()
elif not self.position and self.rising:
self.buy()
`
with ema 200 active this makes sense if the ema 200 is part of the trade condition, but it is not.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Love this program! I'm very new (as my question will substantiate),please forgive me if the answer is glaringly obvious:
I was writing my own indicators in order to help me understand the program and came across something I perceived to be odd.
When I have a few indicators (self.I) I noticed that the first trade will not happen until the indicator with the largest length as been met, even if that indicator is not used as a condition to open or close a trade. In my case I have the following indicators and their lengths; sma/14, rsi/14,ema/50 and ema/200.
If I run with all indicators active (not commented out) the first trade will not happen until the 200th bar, with ema/200 deactive first trade happens at the 63rd bar, and if the ema 50 and ema200 indicators are both deactivated then the first trade happens correctly at the 29th bar. Why do the ema indicators affect when the first trade happens, even when they are not a condition of the trade?
Clear as mud I'm sure , so I hope some code and output snippets will help.
with ema 200 active this makes sense if the ema 200 is part of the trade condition, but it is not.
with ema 50 active and ema 200 inactive
with ema50 and ema 200 inactive and sma/14 and rsi/14 active
Beta Was this translation helpful? Give feedback.
All reactions