San Francisco, CA
Experience: Advanced
Platform: IB-TWS, Ninja, Wave59, R
Broker: IB, IQFeed
Trading: ZB
Posts: 37 since Sep 2013
Thanks Given: 0
Thanks Received: 26
|
Your lines are printing from 2 days ago because of the way OnBarUpdate() works and the fact that you are plotting on a lower time frame.
OnBarUpdate updates at the END of the bar. So if you are in BarsInProgress==1 (or the day data)...and the day is done (when onBarUpdate is called) then you are technically looking back 2 days because onBarUpdate will not get call again for your day data till the end of the day.
Don't know if that makes since or not but basicly try changing High[1][1] to High[1][0]. That should fix it for you.
|