I would like users to be able to put this indicator in any chart.
So in my initialize function, I'm Add() ing both the TICK and the ES instruments. If adding to a chart of AXP, for example, this would give me my bar values in elements 1 and 2 in the BarsArray if I understand correctly.
But what if I add this indicator to a TICK chart? Well then, since TICK is already the primary Bars array, my Add("^TICK...) is ignored (assuming timeframes match).
So my question is... what's the best way to code around this issue so that my code is not dependent on which chart the indicator is placed it? Or do I have to recognize that the primary bars are the same as what I want and handle things differently in the code?
Second question: Since there is no continuous ES contract, how do I set my code up to use the current ES contract without user interaction on every rollover? Am I going to have to calculate the rollover day and 'construct' the ES instrument name (e.g. ES 09-12) on my own?
Thanks for any help.
Comment