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 PaulMohn, Today, 03:49 AM
        0 responses
        7 views
        0 likes
        Last Post PaulMohn  
        Started by inanazsocial, Today, 01:15 AM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by rocketman7, Today, 02:12 AM
        0 responses
        10 views
        0 likes
        Last Post rocketman7  
        Started by dustydbayer, Today, 01:59 AM
        0 responses
        4 views
        0 likes
        Last Post dustydbayer  
        Started by trilliantrader, 04-18-2024, 08:16 AM
        5 responses
        23 views
        0 likes
        Last Post trilliantrader  
        Working...
        X