Spin
Well-known member
- Joined
- May 22, 2019
- Posts
- 474
- Likes
- 189
Dear fellow-coders,
Another day, another coding issue. ❓❓
I am building a Strategy, based on VWAP. I have built quite a few Strategies before, but they were all based on a Study that only contained 'CalculateValues'.
VWAP is different: it contains both 'Calculate' and 'CalculateValues'.
I altered the (standard) MW VWAP Study lightly and it runs fine by itself in its new form on any chart I drop it on: the VWAP gets drawn and updated on each incoming Tick.
However, from the moment I build a Strategy, based on VWAP, and drop in onto a chart, the underlying VWAP simply freezes. Even when I add it to a 'skeleton'-Strategy (containing nothing more than 'Initialize') the VWAP fails to do its job.
A little hint perhaps: when I click the 'pencil' icon, to call the Strategy's menu and close it by selecting 'update' or 'apply', the VWAP gets calculated up until the last bar at that moment. This is the behavior I would like to see, but without passing through the menu, obviously.
I believe this has to do with the VWAP 'Calculate' (and 'onTick ?) function no longer getting called. By using a bunch of 'debug'-lines, I established that 'Calculate' only gets executed upon exiting the menu or the very first tick after the Strategy is dropped on a chart. The same seems to be true for 'onTick'.
Why is this ?
Has anyone experienced similar behavior with the same or another Study ?
Did you get it fixed ?
How ?
All help / input welcome !
Thanks in advance !! 😁
Another day, another coding issue. ❓❓
I am building a Strategy, based on VWAP. I have built quite a few Strategies before, but they were all based on a Study that only contained 'CalculateValues'.
VWAP is different: it contains both 'Calculate' and 'CalculateValues'.
I altered the (standard) MW VWAP Study lightly and it runs fine by itself in its new form on any chart I drop it on: the VWAP gets drawn and updated on each incoming Tick.
However, from the moment I build a Strategy, based on VWAP, and drop in onto a chart, the underlying VWAP simply freezes. Even when I add it to a 'skeleton'-Strategy (containing nothing more than 'Initialize') the VWAP fails to do its job.
A little hint perhaps: when I click the 'pencil' icon, to call the Strategy's menu and close it by selecting 'update' or 'apply', the VWAP gets calculated up until the last bar at that moment. This is the behavior I would like to see, but without passing through the menu, obviously.
I believe this has to do with the VWAP 'Calculate' (and 'onTick ?) function no longer getting called. By using a bunch of 'debug'-lines, I established that 'Calculate' only gets executed upon exiting the menu or the very first tick after the Strategy is dropped on a chart. The same seems to be true for 'onTick'.
Why is this ?
Has anyone experienced similar behavior with the same or another Study ?
Did you get it fixed ?
How ?
All help / input welcome !
Thanks in advance !! 😁
Last edited: