I have an indicator which is set to Calculate on EachTick. Also in my indicator, I add a DataSeries set to 1 Tick.
So, my PRIMARY is 1 min and my SECONDARY is 1 tick.
My code inside my indicator produce a slope calculated on every tick on a period set to 5 (which represent 5 minutes)
In the code, I go through every tick and when the BarInProgress == 0 (Primary) , I do a check to see if the tick is "IsFirstTickOfBar". If yes, I put the "TickIndex - 1" into a variable List which store the tickIndex of the Last Tick of the previous 1 minute Bar.
I use the the PLackBack connection to do my test.
1) First test with PlackBack Connection:
- Everything run smoothly when I start the connection and then loaded my indicator. All data is good.
2) Second test is that I loaded my indicator but with the PlayConnection NOT started.
- The data when I do this is shifted from the test 1.
3) Third Test. I try to load my indicator on NinjaTrader FXCM Demo Connection but have not yet activate the connection. Result are also shifted as per test 2. See graph below. The blue dot have the right value but are not on the right bar. The complete left blue dot should be on the bar to the right and so on. All will come back to normal after 5 bars goes by (My period of 5 for the PRIMARY 1 minute). If my period would be 10 or 25, it would take 10 or 25 bars to come back to normal.
When running test 1: My first TickIndex which correspond to a IsFirstTIckOfBar comes at TickIndex =10.
When running test 2: My first TickIndex which correspond to a IsFirstTIckOfBar comes at TickIndex =9
| Output from TEST 1: | Output from TEST 2: |
| PRIMARY Bar Tick: 8 SECONDARY Bar Tick: 8 PRIMARY Bar Tick: 9 SECONDARY Bar Tick: 9 PRIMARY Bar Tick: 10 First TICK OF BAR Main Primary Count Bar Index Before Add: 0 SECONDARY Bar Tick: 10 PRIMARY Bar Tick: 11 |
SECONDARY Bar Tick: 8 SECONDARY Bar Tick: 9 PRIMARY Bar Tick: 9 First TICK OF BAR Main Primary Count Bar Index Before Add: 0 SECONDARY Bar Tick: 10 SECONDARY Bar Tick: 11 |
Why this behavior? Is this normal?

Comment