Iím trying to make an indicator that draws from information on 3 different tick chart levels, which I could then use for testing in market replay. I have been experimenting on how to do that in multicharts. Here is the code that I used:
MA4 > MA4 AND
MA42 > MA42 AND
MA43 > MA43
This was applied to a chart with three different tick timeframes of the same symbol and then set on market replay. The results were not what I expected. It seemed to partially work, triggering only sometimes.
I am curious what the problem is. Is this type of code possible to do in multicharts. Or will I need to go about this a different way? Global variables, ADE, etc..?
it's difficult to say what exactly would need to be changed when you say the results where not what you expected. What did you expect it to do or what do you want it to do?
One might see your code and and a corresponding chart and say "it's doing exactly what the code says".
When working with multiple timeframes it's usually best to tie the variables to their respective timeframes, too. I'd also reset the plot when the condition is no longer valid.
Check if the code below does what you have in mind.
Hi ABCTG, Thank you for the response, that helped a lot.
You're right, I should have explained a little more. I was expecting to get the situation in which intratick, when all three moving averages were sloping upwards, the indicator would fire. I was experiencing more of the indicators showing only at the high tick frame end of bar and then sometimes it was not showing up at all when I assumed the conditions were met.
Tying the variable to the timeframe made the indicator behave more like what I was hoping. But, I can't seem to wrap my head around how that makes the calculation different. Do you by chance know why?
I realized that the multiframe tick chart was not able to update tick by tick in market replay. So, i'm not sure if this will be useful for my backtesting, maybe only useable in real time.