• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 ralett, Today, 03:09 PM
              1 response
              2 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Started by martyn73, Today, 02:54 PM
              2 responses
              13 views
              0 likes
              Last Post martyn73  
              Started by Zigfried, Today, 01:59 PM
              4 responses
              14 views
              0 likes
              Last Post Zigfried  
              Started by giogio1, 11-10-2019, 11:21 PM
              2 responses
              30 views
              0 likes
              Last Post bltdavid  
              Started by w0lverine, Today, 12:39 PM
              4 responses
              9 views
              0 likes
              Last Post w0lverine  
              Working...
              X