Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnOptimize compile error

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

    OnOptimize compile error

    The OnOptimize cause compile error:

    Code:
    protected override void OnOptimize()
    {
        debugMasterSwitch = false;
    }
    ​
    BWAAAZones.cs,'NinjaTrader.NinjaScript.Strategies. BW4U.BWAAAZones.OnOptimize()': no suitable method found to override,CS0115,856,27,

    #2
    Hello Shai Samuel,

    Thanks for your post.

    OnOptimize() cannot be used in a custom NinjaScript strategy or the compile error you shared would appear.

    This method should be used within a custom Optimizer NinjaScript.

    See this help guide page for information about creating custom Optimizer NinjaScripts: https://ninjatrader.com/support/help.../optimizer.htm

    And, this help guide contains information about the Optimizer method OnOptimize(): https://ninjatrader.com/support/help...onoptimize.htm

    Let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by kinfxhk, 07-14-2026, 09:39 AM
    0 responses
    15 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 10:18 AM
    0 responses
    59 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 09:50 AM
    0 responses
    42 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-13-2026, 07:21 AM
    0 responses
    47 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 07-11-2026, 02:11 AM
    0 responses
    38 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X