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
this solution helped me with the close price to update. I only suspect that this is updating the last close price, and the last close price of in close_array, but not the preceding close prices from where the SMA is calculated? See below example:
Last 5 closes:
454 17.64
455 17.67
456 17.52
457 17.48
458 16.95
dtype: float64
SMA : 17.452
Last 5 closes:
454 17.64
455 17.67
456 17.52
457 17.48
458 16.98
dtype: float64
SMA : 17.458
Issue
The close price does not change each time a new bar is generated.
Cause
In the for loop above "bar" should be changed to something else so that it's not overwritting "bar" from:
def on_bar_update(self, reqId, bar, realtime):
The text was updated successfully, but these errors were encountered: