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

Followed Introduction Without Same Result

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

    Followed Introduction Without Same Result

    Hi all,

    I am new on Ninjatrader but love it already.

    I just followed this introduction video where a simple strategy is built (one SMA crosses another one, leading to long or short order). The video shows the Wizard, the code, gives some programming tips, and then adds the strategy to a chart.

    I am doing the same thing to practise (without unlocking the code) yet I am missing the backtesting orders when the strategy is added to the chart (check the video at 49:40 and you see the moving averages AND the order in the chart). I do see the two lines in my chart (see attached) but the orders do not appear.

    I am using the simulation for now and thought this might have to do with that, so in addition to placing orders, I try to draw a symbol. These also do not show up. I am clearly doing something wrong. Can anybody help please?

    Thank you. P

    Attached Files

    #2
    Hello pennywise,

    Is the strategy enabled?

    Is the Enabled checkbox checked for this strategy instance on the Strategies tab of the Control Center?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello pennywise,

      Is the strategy enabled?

      Is the Enabled checkbox checked for this strategy instance on the Strategies tab of the Control Center?
      You mean the checkbox when I add the strategy to the chart? Yes, it is. See attached.
      Attached Files

      Comment


        #4
        Hello pennywise,

        May I test your script?

        To export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:
        1. Click Tools -> Export -> NinjaScript...
        2. Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
        3. Click the 'Export' button
        4. Enter a unique name for the file in the value for 'File name:'
        5. Choose a save location -> click Save
        6. Click OK to clear the export location message
        By default your exported file will be in the following location:
        • (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
        Below is a link to the help guide on Exporting NinjaScripts.


        Once exported, please attach the file as an attachment to your reply.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Please see attached. Thank you for looking into this. Much appreciated. aaaMB02.zip

          Comment


            #6
            Hello pennywise,

            I have tested the script and I am finding the script is placing orders.




            Are you 100% certain the script is enabled on your end?

            May I have a screenshot of your chart?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thank you for this, and thanks for the video, very helpful. Yes, my strategy was enabled.

              However, I found that the strategy is placing orders, but when orders are placed, they are not shown in the chart (and past orders are not shown which triggered this whole conversation). This gave the hint to check the data series and I saw my "plot execution" setting was set to "Do no plot" (see screenshot attached). When I changed this the orders appeared (past and current). I should have seen this before, I apologize.

              The only question left is why the arrows that I wish to draw at the time of placing orders do not appear. Do you have an idea about this? Maybe another setting that I am not aware of?
              Attached Files

              Comment


                #8
                Hello pennywise,

                If you mean the arrows you added to the script, I see you currently have them set to AutoScale False and also a value of 0. They should be drawn but they will be outside of the visible area in the chart.

                To fix this you would need to supply a value when you configure the drawing object, using AutoScale = true can also help with problems. In this case if autoscale was true, and 0 was used the chart would compress a lot distorting the view. This will let you know where the object is and would be obvious the value is not expected.


                Code:
                Draw.ArrowDown(this, @"aaaMB01 Arrow down_1", [B]true[/B], 0, [B]Close[0][/B], Brushes.Red);
                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Thanks, Jesse, very clear! I am using an ellipse now that does get drawn properly:

                  Draw.Ellipse(this, @"aaaMB02 Ellipse_1", false, 5, Low[0], 0, High[0], Brushes.Red, Brushes.Red, 0);

                  Interestingly, it only gets drawn for the last trade. All the previous trades (in the backtesting of the strategy) do not show it. Let's see if I can figure out why that is.

                  Thanks again for your help, Jesse and ChelseaB.

                  Comment


                    #10
                    Hello pennywise,

                    If you would like multiple drawing objects use unique tag names (instead of updating an existing object by re-using a tag name).

                    https://ninjatrader.com/support/foru...630#post838630
                    Last edited by NinjaTrader_ChelseaB; 06-06-2019, 07:57 AM.
                    Chelsea B.NinjaTrader Customer Service

                    Comment


                      #11
                      Makes total sense. Thank you.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by ScottW, Today, 06:09 PM
                      1 response
                      4 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Started by ScottWalsh, Today, 06:52 PM
                      0 responses
                      4 views
                      0 likes
                      Last Post ScottWalsh  
                      Started by ftsc2022, 10-25-2022, 12:03 PM
                      5 responses
                      256 views
                      0 likes
                      Last Post KeyonMatthews  
                      Started by Board game geek, 10-29-2023, 12:00 PM
                      14 responses
                      244 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Started by Waxavi, 04-19-2024, 02:10 AM
                      4 responses
                      56 views
                      0 likes
                      Last Post sonia0101  
                      Working...
                      X