Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.



      Chris L.NinjaTrader Customer Service

      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 giulyko00, Yesterday, 12:03 PM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by habeebft, Today, 07:27 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_ChristopherS  
        Started by AveryFlynn, Today, 04:57 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by Max238, Today, 01:28 AM
        4 responses
        39 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by r68cervera, Today, 05:29 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X