Announcement

Collapse
No announcement yet.

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:	138
Size:	45.5 KB
ID:	1187255
    It works with the default settings of 1:
    Click image for larger version

Name:	2.png
Views:	210
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:	197
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.

    Comment


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

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      51 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X