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

Please help for a good indicator

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

    Please help for a good indicator

    I have problems for my programming. The program is not a complicated case but I always have error message in the compiling step. I am new to Ninja and never did ninja programming before. Please help me to get the program. It is a very good indicator.
    A=EMA(Close, 3)[3];
    B=EMA(Close, 5);
    C=EMA(Close,15);
    There will be three plots in a individual chart: 1st one is the difference of A and B or ( EMA(Close, 3)[3]-EMA(Close, 5) ); 2nd one is the difference of A and C or (EMA(Close, 3)[3]-EMA(Close, 15);3rd one is the zero line.
    If B cross over A, that is a buy signal (using a shape up arrow for indication). If C cross over A, that is a sell signal (using a shape down arrow for indication).
    Thanks a lot!

    #2
    Hello,

    Post the body of the indicator code itself and we can give you pointers.
    A way to at least locate the error is to comment out parts of the code until it compiles. Then you know the last thing you commented out contains the error.
    DenNinjaTrader Customer Service

    Comment


      #3
      Ben, thanks for your information and help.
      Please check the code file I attached and correct the mistakes.
      I am a new user and had to write the codes by referring to some other Ninja trader files.
      Attached Files

      Comment


        #4
        mydream09, I would suggest using unique tag ID's for your two DrawArrow calls, if you use only one you only modify one arrow all the time your rules call for it...to do this easiest is too add CurrentBar to your chosen tag like

        Code:
        DrawArrowUp("tag1" + CurrentBar, true, 0, Low[0] - TickSize, Color.Green);
        BertrandNinjaTrader Customer Service

        Comment


          #5
          Bertrand, thanks for your correction and I modified my file. Please give me more suggestions.

          Comment


            #6
            You're welcome - I'm not sure what you're looking for exactly. What result are you getting? What does work, what does not work? Which errors are you getting if any? Thanks!
            BertrandNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Waxavi, Today, 02:10 AM
            0 responses
            2 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Started by TradeForge, Today, 02:09 AM
            0 responses
            4 views
            0 likes
            Last Post TradeForge  
            Started by Waxavi, Today, 02:00 AM
            0 responses
            2 views
            0 likes
            Last Post Waxavi
            by Waxavi
             
            Started by elirion, Today, 01:36 AM
            0 responses
            4 views
            0 likes
            Last Post elirion
            by elirion
             
            Started by gentlebenthebear, Today, 01:30 AM
            0 responses
            4 views
            0 likes
            Last Post gentlebenthebear  
            Working...
            X