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

CrossBelow and Compiled Strategies

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

    CrossBelow and Compiled Strategies

    Hello. I have two questions. When am about to start back testing a strategy and I select it from the drop down box I see that there are other old strategies that I do not use anymore in the list. Is there a way to remove them from the list?

    My second question involves the CrossBelow and CrossAbove. I sell on a crossbelow of moving averages among some other conditions, but on the trade last night, the moving averages didn't actually cross. Do you know what went wrong? Is there a way to fix this? I have tried to include an attachment of the picture.

    Thanks
    Attached Files

    #2
    1) Tools > Edit NinjaScript > Strategy > Select the strategy you wish to remove and press the "Delete" button

    2) You likely ran your strategy with 'Calculate on bar close" set to false, sometime during the bar the cross occured which triggered your logic but on the bar close, it was not crossed.
    RayNinjaTrader Customer Service

    Comment


      #3
      Sorry I was not clear on the first question. I have deleted the strategy from the menu that you mentioned, but the strategy name is still in the drop-down list of choices. Also, if I try to compile a strategy with the name of the old deleted strategy I get the error that there is already a definition for that name.

      As for the second question, the goal is to run the entry code at the close of each 15 min bar and then run position management with each incoming tick. If I set CalculateOnBarClose to true, use 15 min as the main data series, and add tick data to the code, would using BarsInProgress make this idea work?

      Comment


        #4
        1) You will need to double check again for your strategy. If it is still referencing it it is still there somewhere. Look around. Recompile something. It has to be there somewhere.

        2) That would work or you could try just using an if statement bracket with the condition if (FirstTickOfBar) to run around your orders. Please take note that if you run FirstTickOfBar you want to reference everything back one. So you want to reference Close[1] instead of Close[0] for the most recently closed bar. Then if you are running limit or stop orders you will probably want to set them to liveUntilCancelled = true.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          I thought that the script files all had to be in the one particular folder. I found the file in another folder. Thank you for your help. I also just want to say that I love ninjatrader and you guys provide great support. I really appreciate it.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by wuannetraam, Today, 08:20 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by HappyTrader76, 02-07-2023, 08:46 AM
          6 responses
          333 views
          0 likes
          Last Post SnailHorn  
          Started by geotrades1, Today, 07:54 AM
          6 responses
          14 views
          0 likes
          Last Post geotrades1  
          Started by Aviram Y, Today, 06:03 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by leonardomocci, Today, 08:28 AM
          0 responses
          4 views
          0 likes
          Last Post leonardomocci  
          Working...
          X