Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CrossAbove() numerical value?

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

    CrossAbove() numerical value?

    Hi,

    I am trying to build a CrossAbove condition that triggers when an indicator crosses above a fixed numerical value.

    Ideally this would look like this, where 3 is my fixed numerical value.
    Code:
    if (CrossAbove(IndicatorSeries, [COLOR=#e74c3c][B]3[/B][/COLOR], 1))
    {
    EnterLong();
    }
    I understand that the second argument should take a series, so I am left with this error:
    Argument 2: cannot convert from 'double' to 'NinjaTrader.NinjaScript.ISeries<double>'

    Is there any workaround to this? Can I create a series that is constantly equal to 3?

    #2
    Hello collic653,
    CrossAbove syntax is correct, quite possible that this error is due to some other reason, we should have a look at entire code for better understanding the error reason.

    Comment


      #3
      Hello collic653, thanks for writing in.

      You do have this correct assuming IndicatorSeries is set up properly. Can you confirm that you have IndicatorSeries set up as a series and not a double variable?

      I would need to see the full details if this is set up properly. You may Export it then either post it here or send it to
      platformsupport at ninjatrader.com

      and reference "Attn ChrisL 2806866" in the body of the email.

      I look forward to hearing from you.



      Comment


        #4
        Hi guys, thanks for reviewing. I think I figured it out... sorry for the unnecessary post. I believe I just need to remove the bar index from indicator

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        62 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        134 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 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
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X