Dear All
I want to build a strategy (on each tick calculation) and I need to compare the value of 5-minutes MACD of 1-minute 1 bars ago with the value of 5-minutes MACD of 1-minute 2 bars ago. Anyone any idea for the logic using strategy builder to be storing these two values as variables in order to compare?
Thank you everyone
Moving averages gets you 100% there
1 Like
What @Maverick has said it true - there is a general equivalence between a moving average with a longer length and a shorter length on a faster timeframe. And Strategy Builder doesn’t really understand how to create the necessary code structures to keep track of a series on a slower time frame. But, you could do this in NinjaScript pretty easily (without Strategy Builder). Try using ChatGPT or Claude to ask it for the NinjaScript code to do what you’re trying to do, and it will probably get you in the ballpark then you can continue working on it from there.
1 Like
just ensure you add both periods to your input via code