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

Name:	2.png
Views:	227
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:	212
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, 05-11-2026, 05:56 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      32 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      195 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      356 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      277 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X