Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

simple strategy not working

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

    simple strategy not working

    Hi,

    I wrote the simple strategy using strategy wizard and it is not working. Can you please check what is wrong with it.

    Rules are:
    if cci(100) > 0 and cci(100) cross above sma(20) draw up arrow
    if cci(100) < 0 and cci(100) cross below sma(20) draw down arrow

    Thanks in advance
    Attached Files

    #2
    Hello billsingh,

    Thank you for your inquiry.

    Can you please clarify how the strategy is not working?

    I did want to note that your up and down arrows are plotting at a Y value of 0. This would mean that the arrows would be plotting at the price of 0 on a chart.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      it does not print the arrows

      Comment


        #4
        should I change it to close(0) ???? I like to draw the arrow as soon as condition happens on the current bar ???

        Comment


          #5
          Hello billsingh,

          The Y position of your arrows would be up to you.

          The strategy as attached, without modification, prints arrows on my end, though at the price of 0 as programmed.

          Arrows not printing would denote that the conditions have not been met for the arrows to be drawn.

          I would suggest adding Print statements to output the values needed for your conditions so you can manually check if an if statement should be true or not.

          Adding Print statements would denote unlocking your code, however, as these need to be manually added in through code. Please be aware that unlocking your code will prevent you from using the Strategy Wizard again to modify the code.

          This post on our support forum provides helpful information about debugging NinjaScript code: http://ninjatrader.com/support/forum...58&postcount=1
          Zachary G.NinjaTrader Customer Service

          Comment


            #6
            Can you please tell me how I can draw arrow at current price....I don't understand when you say price 0..what should I add instead of 0 to have it draw at current price ???

            Comment


              #7
              Hello billsingh,

              If you would like your arrows to be drawn at the close price of a bar, you would use Close[0].

              Putting 0 as your Y value would plot the arrows at the price of 0. Setting it to Close[0] would set the arrow at the close price of a bar.

              When modifying an arrow's parameters in the Strategy Wizard, you'll want to click on the 0 and select the ellipses (...) button to specify the Y location.
              Attached Files
              Zachary G.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by jclose, Today, 09:37 PM
              0 responses
              6 views
              0 likes
              Last Post jclose
              by jclose
               
              Started by WeyldFalcon, 08-07-2020, 06:13 AM
              10 responses
              1,414 views
              0 likes
              Last Post Traderontheroad  
              Started by firefoxforum12, Today, 08:53 PM
              0 responses
              11 views
              0 likes
              Last Post firefoxforum12  
              Started by stafe, Today, 08:34 PM
              0 responses
              11 views
              0 likes
              Last Post stafe
              by stafe
               
              Started by sastrades, 01-31-2024, 10:19 PM
              11 responses
              169 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X