Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New to Ninjascript need help

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

    New to Ninjascript need help

    Hi All,
    Seems like great community by just lookat at the forum. I am new to Ninjascript and need some help. I like to achieve the following and just want to verify that my code is right.

    1. Price clearly above Bollinger bands

    2. MACD histogram above zero line

    3. RSI above 50

    My code is

    if (CrossAbove(Close, Bollinger(2, 14).Lower, 1)
    && MACD(12, 26, 9).Avg[0] > 0
    && RSI(14, 9).Avg[0] > RSIup)

    Thanks in advance.
    Bill

    I am actually trying to automate or auto trade the following but it only shows I order for the whole year.



    I am not sure what I am doing wrong. Can someone create the stregedy and post it please.
    Last edited by billsingh; 10-26-2014, 03:23 PM.

    #2
    Hello Bill,

    Thank you for your post and welcome to the NinjaTrader Support Forum!

    Your code appears to be correct. What are seeing that is not expected?

    Comment


      #3
      Here is the whole code. it only produce one order for the whole year.
      Attached Files

      Comment


        #4
        Hello billsingh,

        Thank you for your response.

        Can you provide a screenshot of the settings used in the Strategy Analyzer? What instrument are you testing?

        Comment


          #5
          Hello billsingh,

          Thank you for your patience.

          It seems we are working via e-mail as well. I will continue to follow up with you via e-mail.

          Comment


            #6
            Originally posted by billsingh View Post
            Here is the whole code. it only produce one order for the whole year.
            Your code has this: (which is enforcing a 3:45:00pm time for all conditions?

            Code:
                            && ToTime(Time[0]) > ToTime(10, 0, 0)
                            && ToTime(Time[0]) == ToTime(15, 45, 0)
            Did you mean this? (between 10:00:00am and 3:45:00 pm)

            Code:
                            && ToTime(Time[0]) > ToTime(10, 0, 0)
                            && ToTime(Time[0]) [B]<[/B] ToTime(15, 45, 0)

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            650 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            370 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            109 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            574 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            577 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X