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

Name:	2.png
Views:	220
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:	205
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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      89 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X