Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

More strange behavior with strategy... sad face...

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    More strange behavior with strategy... sad face...

    Hello All !!

    Tooling along with this new strategy... then some strange things began to happen with the strategy.

    I'll explain (through my headache =>)(<=

    The strategy is simple. I have it set to "calculate on bar close == false."

    For testing purposes, I also have it set so that (during a downward trending market) whenever the current bid is greater than the previous bar's close... draw a green dot. Here's condition set 1 (the strategy contains no other conditions)

    If:
    Close[1] < Open[1]
    GetCurrentBid() > Close[1]
    Do the following:
    Draw a dot

    So... either live or in replay... when the market is flushing... and I get red bar after red bar flushing downward on the 10 range bar chart... if suddenly, during this mad dash for the bottom of the market, the bid goes higher than the previous bar's close... and a bit of a green bar forms... the strategy is instructed to draw a green dot there. Of course, this is not a reversal or a pullback... it's just a place where the bid goes higher than the previous close... and of course... the market reverses immediately and keeps going downwards... as expected in this particular case... since it is a flush... This happens a few times and leaves a few green dots.

    Now... I've notice behavior with the strategy which is very strange to me, and I'm hoping someone here can help me with it.

    When I load the strategy into the chart... as I mentioned above, it draws dots wherever the bid went higher than the previous bar's close in the past (or at least that's what I'm expecting). As I scroll to the left on my chart... there are dots...

    Now... I expect that those dots are drawn wherever the bid went higher than the previous bar's close (each and every time it occurred)... even those ones during a flush down as described above... but... nope... that's not what's happening. Some of these events (which actually did occur) are being omitted, and their dots are not being drawn on the chart after the chart is reloaded. They are vanishing into thin air, as if they never happened.

    In today's YM chart (7/30/14)... there is a flush which begins at around 9:00. During this flush, there were a few times when the bid went above the close of the previous bar, and it triggered a green dot. This happened several times as the flush developed... but... when I came back after lunch... and reloaded the charts, those dots, were gone... as if they never happened. So... perplexed... I exit CQG live feed, load the replay of the day, and replay that portion of the day, and I get the green dots as those events are replaying, just like I did in real time when they first occurred (see the attached screenshots). However, if I fast forward to later in the day, begin replay, and look backwards on the chart to where that flush occurred earlier in the day, those dots are gone, as if those "bid above the previous bar's close" events never occurred (when we all KNOW they did). The only time I see the dots, is when I go back to that spot, and replay that segment of the day (again, please see the screenshots, especially the last one after the first part of the flush is over. Notice the time on the replay control, and notice the dots are gone).

    Does anybody have any idea why this is happening? Shouldn't these dots still show up in my historical record (since they did occur)? Is NinjaTrader somehow choosing which dots to keep and which to discard? Why would the dots show up when the replay is running past those bars, but then somehow not show up in history?

    Oh my aching head!

    -V
    Attached Files

    #2
    Hi Aurum, I would expect that outcome comparing historical backtest to realtime simulation or replay, as the GetCurrentBid would be just the Close[0] value in backtesting.

    Comment


      #3
      Originally posted by Aurum View Post
      Hello All !!

      Tooling along with this new strategy... then some strange things began to happen with the strategy.

      I'll explain (through my headache =>)(<=

      The strategy is simple. I have it set to "calculate on bar close == false."

      For testing purposes, I also have it set so that (during a downward trending market) whenever the current bid is greater than the previous bar's close... draw a green dot. Here's condition set 1 (the strategy contains no other conditions)

      If:
      Close[1] < Open[1]
      GetCurrentBid() > Close[1]
      Do the following:
      Draw a dot

      So... either live or in replay... when the market is flushing... and I get red bar after red bar flushing downward on the 10 range bar chart... if suddenly, during this mad dash for the bottom of the market, the bid goes higher than the previous bar's close... and a bit of a green bar forms... the strategy is instructed to draw a green dot there. Of course, this is not a reversal or a pullback... it's just a place where the bid goes higher than the previous close... and of course... the market reverses immediately and keeps going downwards... as expected in this particular case... since it is a flush... This happens a few times and leaves a few green dots.

      Now... I've notice behavior with the strategy which is very strange to me, and I'm hoping someone here can help me with it.

      When I load the strategy into the chart... as I mentioned above, it draws dots wherever the bid went higher than the previous bar's close in the past (or at least that's what I'm expecting). As I scroll to the left on my chart... there are dots...

      Now... I expect that those dots are drawn wherever the bid went higher than the previous bar's close (each and every time it occurred)... even those ones during a flush down as described above... but... nope... that's not what's happening. Some of these events (which actually did occur) are being omitted, and their dots are not being drawn on the chart after the chart is reloaded. They are vanishing into thin air, as if they never happened.

      In today's YM chart (7/30/14)... there is a flush which begins at around 9:00. During this flush, there were a few times when the bid went above the close of the previous bar, and it triggered a green dot. This happened several times as the flush developed... but... when I came back after lunch... and reloaded the charts, those dots, were gone... as if they never happened. So... perplexed... I exit CQG live feed, load the replay of the day, and replay that portion of the day, and I get the green dots as those events are replaying, just like I did in real time when they first occurred (see the attached screenshots). However, if I fast forward to later in the day, begin replay, and look backwards on the chart to where that flush occurred earlier in the day, those dots are gone, as if those "bid above the previous bar's close" events never occurred (when we all KNOW they did). The only time I see the dots, is when I go back to that spot, and replay that segment of the day (again, please see the screenshots, especially the last one after the first part of the flush is over. Notice the time on the replay control, and notice the dots are gone).

      Does anybody have any idea why this is happening? Shouldn't these dots still show up in my historical record (since they did occur)? Is NinjaTrader somehow choosing which dots to keep and which to discard? Why would the dots show up when the replay is running past those bars, but then somehow not show up in history?

      Oh my aching head!

      -V
      When you backtest, you are perforce using Historical data. The ONLY data points available are OHLC, so that is the only data that can be processed. IOW, any intrabar niceties or shenanigans cannot be shown, because that data is not part of the processing stream when you are using Historical data.

      Comment


        #4
        Thanks you Bertrand and Koganam, for your replies.

        So, just to be crystal clear, if an order is filled in the middle of a bar in real time, this will not show up when I'm looking at charts after the fact? In other words, I will not be able to access a visual representation of those orders on the chart?

        Also... just to be clear... once the current bar has closed, this is now "historical" data?

        Thanks for your help on these things... I'm definitely in the tall grass at the moment.

        -V

        Comment


          #5
          Originally posted by Aurum View Post
          Thanks you Bertrand and Koganam, for your replies.

          So, just to be crystal clear, if an order is filled in the middle of a bar in real time, this will not show up when I'm looking at charts after the fact? In other words, I will not be able to access a visual representation of those orders on the chart?
          Not quite. The particular type of visual dynamic visualization that you described will not be seen. However, an execution price in the middle of the bar would be seen as executed at the specified price, provided only that the bar after the order was placed spans the bar on which the order was placed. i.e., if such happens, then at some time during the construction of the execution bar, the execution price was met and filled at that price (if limit). If a Market Order, slippage will be taken into account.
          Also... just to be clear... once the current bar has closed, this is now "historical" data?
          Pretty much.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          639 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          366 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          107 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          569 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          572 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X