Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

HELP! Trying to replace one indicator

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

    HELP! Trying to replace one indicator

    I have a strategy that is a little on the complicate side. All I want to do however is switch out a Moving Average EMA with a different moving average. I keep getting these errors, though:

    1) NT1503 and

    2) The following CS1502 error code (information is provided within the context of NinjaScript. The examples provided is only a subset of potential problems that this error code may reflect. In any case, the examples below provide a reference of coding flaw possibilities.)

    Any suggestions: I get the error code here:

    Line 645L

    // Trigger
    sTrigger.Set(JMA(Close, iTriggerPeriod)[0]); (changed it from EMA)


    #2
    Nillie, unfortunately I'm not familiar with the JMA indicator, but the errors show that the arguments provided to the JMA() method aren't what the indicator is looking for. Would you be able to share the JMA indicator so I can see what could be going wrong?
    AustinNinjaTrader Customer Service

    Comment


      #3
      Help

      here it is.
      Attached Files

      Comment


        #4
        Nillie, thanks for sharing. There is actually another parameter you must specify in order to use the JMA() indicator called Phase, which has a default value of 0. Please try this following bit of code and let me know if it does the trick:
        Code:
        // JMA overload: JMA(Data.IDataSeries input, int length, double phase)
        sTrigger.Set(JMA(Close, iTriggerPeriod, 0)[0]); //(changed it from EMA)
        AustinNinjaTrader Customer Service

        Comment


          #5
          Thanks!!!! Code Generates successfully. I should be able to use it with JMA now, correct?

          Comment


            #6
            Nillie, that is correct. Please let me know if you run into any issues.
            AustinNinjaTrader Customer Service

            Comment


              #7
              Yes its not plotting. Is it because the EMA was connected to User defined imputs? Was i suppose to add sTrigger.Set(JMA(Close, iTriggerPeriod, 0)[0]); //(changed it from EMA) as well?

              Comment


                #8
                It is necessary to replace your original line of code (with just two parameters for JMA) with the line I provided. Even if the EMA was connected to user defined inputs, the new JMA parameters reflect that, so there shouldn't be an issue there. Please try this bit of code:
                Code:
                double currentJMA = JMA(Close, iTriggerPeriod, 0)[0];
                sTrigger.Set(currentJMA);
                AustinNinjaTrader Customer Service

                Comment


                  #9
                  Its showing code is generated successfully, but it is not plotting on my charts or taking trades.

                  Comment


                    #10
                    Are there any errors in the logs (right-most tab of Control Center)? If not, then could you post the strategy here so I can take a closer look?
                    AustinNinjaTrader Customer Service

                    Comment


                      #11
                      Can I jst send it to you?

                      Comment


                        #12
                        Nillie, you can send it to support <at> ninjatrader <dot> com with 'Attn: Austin - ticket 356133' in the subject line. Thank you.
                        AustinNinjaTrader Customer Service

                        Comment


                          #13
                          I did. I got the auto generated message thing. Let me know.

                          Comment


                            #14
                            So I have a repaint bar, and I want it only to repain the sideways bars and not the up/ dwn candles. Then I would like to add this parameter to my strategy (not to enter on sideways bars that are reapinted.) How do I do that?

                            Comment


                              #15
                              Hello Nillie,

                              Please post only once. You asked the same question in 3 places.

                              You have to identify the conditions that cause the painting and work from that. You are not able to enter on red bars, but rather the conditions that cause bar red.
                              Ryan M.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              595 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              343 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              103 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              556 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              554 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X