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

Name:	2.png
Views:	203
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:	192
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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      55 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      132 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X