Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Newbie Setup & Use Questions

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

    Newbie Setup & Use Questions

    I am new to this product and I am attempting to create a system to automate what I do manually (i guess why we are using this product).

    I am attempting to generate a simple script and am able to do so. What I am not sure of is what to do next.

    How to I test to see that the script functions as written. I connected to the Sim data, but not seeing anything.

    Any and all help would be greatly appreciated.

    Thanks

    #2
    Hello captnops,

    Instructions to run automated strategies can be found at the links below.

    Strategies-tab


    Chart


    Note that the Simulated Data Feed does not support historical data. If you connect for the first time, you will not see any data initially. Please wait a few minutes and you should see data building in the chart.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Hi Jason and thanks for the info.

      I read through that, but I am not seeing any results, so I may not be setting everything else up correctly.

      I was finally able to see some data in the chart using the DOW 30 instrument list and AA (alcoa) instrument.

      I created a basic SMA crossover signal that puts a buy arrow on a break above 20 period SMA and applied it to the chart and set the trend selector all the way up.

      I am still not seeing the strategy doing anything....

      Comment


        #4
        Please post your code and a screenshot of your chart where you feel its not doing anything. You could just try the SampleMACrossOver strategy too. It will trade whenever the fast period SMA crosses above or below the slow period SMAThank you.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Does it take quite a while for the chart to populate with bars before you may see anything? I let a chart run for a while and was able to see the bars, but nothing triggered.

          Comment


            #6
            captnops,

            You need at least 20 bars before the strategy will begin calculating. Depending on your indicator period's it would require even more bars before any trades will be taken.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              I am basically trying to understand the programming, so I was trying to build a very simple script:

              I want to draw and UP arrow on the chart, when the high of the current tick exceeds a 20 period SMA.

              Seems pretty straighforward, but no joy.

              Thanks

              Comment


                #8
                Could you please post your code and the screenshot that Josh requested in post #4.

                In addition, you could also contact any of the supported NinjaScript consultants at the link below.
                JasonNinjaTrader Customer Service

                Comment


                  #9
                  Here is the code.

                  Thanks
                  Attached Files

                  Comment


                    #10
                    And the chart:
                    Attached Files

                    Comment


                      #11
                      Thanks, Captnops.

                      What's happening is you're drawing your arrows at 0. Take a look at the DrawArrowUp() method here:


                      Provided in the link above is a good example that draws the arrow below the low - 1 tick.
                      Code:
                      DrawArrowUp("tag1", true, 0, Low[0] - TickSize, Color.Red);
                      Ryan M.NinjaTrader Customer Service

                      Comment


                        #12
                        I altered the script to paint the arrow -1 bar ago, but still nothing is drawn. Is it possibly a problem with the logic:

                        Paint the arrow when the price crosses above the 20 period SMA?

                        I used the wizard to create the rule and it seemed logical.

                        Also, is it possible to alter the rule when it has already been placed in a chart that is generating prices and have the changes take effect, or do I need to remove the strategy from the chart, alter it, and reapply?

                        Thanks

                        Comment


                          #13
                          OK. I was able to get the arrows to draw on the chart. Thank you for all the help.

                          Is there a way to limit how often the arrows are drawn? I would only want to draw the arrows if the strategy condition was true and if that condition has not happened in the last 20 periods.

                          Thank you

                          Todd

                          Comment


                            #14
                            Todd, first of all to see the changes after compiling the code you can simply hit the F5 key when the chart is selected.

                            There is most certainly a way to limit how often the arrows are drawn. Since NinjaScript is based off of C#, anything you can imagine you can create if you have enough programming experience.

                            Not knowing what exactly you're trying to do this code could be a good starting point:
                            Code:
                            if (condition is true && CurrentBar > (barOfArrow + 20))
                            {
                                barOfArrow = CurrentBar
                                DrawArrow(...)
                            }
                            AustinNinjaTrader Customer Service

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by NancyEllis, Today, 12:17 PM
                            0 responses
                            4 views
                            0 likes
                            Last Post NancyEllis  
                            Started by robbymane, Today, 12:08 PM
                            0 responses
                            12 views
                            0 likes
                            Last Post robbymane  
                            Started by WaleeTheRobot, 01-07-2024, 10:07 AM
                            35 responses
                            1,338 views
                            2 likes
                            Last Post tommytrades2  
                            Started by Rudmax, 07-02-2024, 05:40 AM
                            34 responses
                            508 views
                            1 like
                            Last Post benghabili  
                            Started by Atlas_Trading, Today, 11:27 AM
                            0 responses
                            5 views
                            0 likes
                            Last Post Atlas_Trading  
                            Working...
                            X