Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Crossover Vs greater than /less than clarifications

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

    Crossover Vs greater than /less than clarifications

    Also looking for some clarification regarding the, bars ago feature.

    So first up when looking for a specific time WHEN one plotted line crosses another should you use the Crossover/ crossunder feature? Vs the plotted value simply being over the other plotted value, which is what the greater/less than feature is? what about articulating both in a strategy separately will this prevent what I call tickabove and immediate tick below false signals?

    Also regarding the bars ago does this mean at any time between current bar and X number of bars ago? or is it articulating a specific number of bars ago only?

    #2
    Hello Daryl,

    Thanks for your questions.

    CrossAbove and CrossBelow will look for a cross that happens going so many bars back as specified for the barsAgo. It will look for the value being "crossed over" rather simply "being above."

    what about articulating both in a strategy separately will this prevent what I call tickabove and immediate tick below false signals?
    I may not understand the question fully, so please provide clarification if it sounds like I am missing the picture. Between an indicator and a strategy, using the same logic on the same data should have the same result.

    Now if you mean false positives, for example, where you are calculating on each tick and a cross over occurs on an incoming tick before the bar closes, and then the bar closes and the indicator plot is no longer at a level that would signal a crossover, this would be a limitation for detecting cross overs on a pending value before it is locked into the indicator plot.

    Also regarding the bars ago does this mean at any time between current bar and X number of bars ago? or is it articulating a specific number of bars ago only?
    It would be representing "within the last X bars" You may observe with the following test that you will receive 5 prints for each bar after the crossover have occurred.

    Code:
    protected override void OnBarUpdate()
    {
    	if (CurrentBar < 1)
    		return;
    	if(CrossAbove(SMA(1), 2830, 5))
    		Print("Cross");
    }
    Please let me know if I can be of additional help.

    Comment


      #3
      It might require setting multi stage multi condition variables but the idea would be to detect _that_ a cross over has occurred, and that it hasn't just instantly crossed back the other direction again. I think you've clarified things for me pretty well. here. Especially the point about separating the cross over Lookback distinction from the bars ago distinction. It would appear that both are essentially a moving window that is inclusive of all bars within it.

      Originally posted by NinjaTrader_Jim View Post
      Hello Daryl,

      Thanks for your questions.

      CrossAbove and CrossBelow will look for a cross that happens going so many bars back as specified for the barsAgo. It will look for the value being "crossed over" rather simply "being above."


      I may not understand the question fully, so please provide clarification if it sounds like I am missing the picture. Between an indicator and a strategy, using the same logic on the same data should have the same result.

      Now if you mean false positives, for example, where you are calculating on each tick and a cross over occurs on an incoming tick before the bar closes, and then the bar closes and the indicator plot is no longer at a level that would signal a crossover, this would be a limitation for detecting cross overs on a pending value before it is locked into the indicator plot.


      It would be representing "within the last X bars" You may observe with the following test that you will receive 5 prints for each bar after the crossover have occurred.

      Code:
      protected override void OnBarUpdate()
      {
          if (CurrentBar < 1)
              return;
          if(CrossAbove(SMA(1), 2830, 5))
              Print("Cross");
      }
      Please let me know if I can be of additional help.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      56 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      133 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X