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

Need help. Wonder why Input parameters aren't "working" during Optimization

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

    Need help. Wonder why Input parameters aren't "working" during Optimization

    Hi, I am making a very simpel strategy as you can see in the attached picture: (Close[0] > Close [my custom parameter]) {enterlong}
    Click image for larger version

Name:	1.png
Views:	98
Size:	45.5 KB
ID:	1187255
    It works with the default settings of 1:
    Click image for larger version

Name:	2.png
Views:	146
Size:	516.5 KB
ID:	1187256
    But when I try an optimized test (in this test parameter min1 to max5 with increments of 1), no trades are placed:
    Click image for larger version

Name:	3.png
Views:	142
Size:	1.02 MB
ID:	1187257
    Any help would be appreciated,
    For context I am very new to this (less than a week of actual coding experience)
    Thanks in advance and kind regards,
    Carl
    Attached Files

    #2
    Hello Cavaro,

    Thanks for your post.

    When optimizing you are changing the look back (Bars ago) of the Close value in the condition statements. When set to 1 this works because you have prevented the script from running until you have one bar processed (if (CurrentBar <1 ) return

    However, when you use a larger value of bars ago the script will likely error out. Always check the "Log" tab of the Ninjatrader Control center when anything is not working as expected because this is where any error messages would appear. You likely have bar index error messages.

    You would need to set your CurrentBar check to be the largest lookback value used.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi Paul,
      Indeed, spot on thank you it is much appreciated!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,404 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by Shai Samuel, 07-02-2022, 02:46 PM
      4 responses
      95 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by DJ888, Yesterday, 10:57 PM
      0 responses
      7 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by MacDad, 02-25-2024, 11:48 PM
      7 responses
      159 views
      0 likes
      Last Post loganjarosz123  
      Started by Belfortbucks, Yesterday, 09:29 PM
      0 responses
      8 views
      0 likes
      Last Post Belfortbucks  
      Working...
      X