Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can't enable strategy, no compilation error, log entry...

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

    Can't enable strategy, no compilation error, log entry...


    Hi everyone, I have the attached strategy but when I try to attach it to my chart (5 minute MNQ), I can't click enable. When I select enable, apply, it unselects the strategy again.
    I tried.
    • looking a log files, no entry is posted in the log window
    • manually compiled and unlocked the strategy
    • repaired NT8 database
    • restrated NT8 a few times

    What is causing this issue and why is there no error message when there clearly seems to be a problem?
    Thanks!
    Attached Files

    #2
    I think I figured it out.. I wanted the take profit be linked to the slow moving average, but I think this is a catch 22 on a "per tick" calculation as the EMA will constantly move and as such not be a fixed target. Would appreciate any advice per the above strategy how I could still accomplish the objective of a take profit being hitting the EMA (with an offset).

    Many thanks!

    Comment


      #3
      Hello money0101,

      If the Strategy is immediately becoming disabled this means that either there is a run time error appearing on the Log tab of the Control Center, or the Account selection has been changed.

      When enabling the strategy do you see errors appearing on the Log tab of the Control Center?


      Note, in the script you have provided there is invalid code that will cause a run time error (that will appear on the Log tab of the Control Center).

      SetProfitTarget(@"golong", CalculationMode.Price, (EMA2[0] + 5) );
      SetProfitTarget(@"goshort", CalculationMode.Price, (EMA2[0] - 5) );​

      Indicator values cannot be used in OnStateChange(). These can only be used in OnBarUpdate() as the bar updates.
      You will not be able to use an indicator as an order price for a profit target on the Stops and Targets page. You will need to send an exit order from the Conditions and Actions page instead.

      Below are links to examples of using Exit methods to dynamically place orders at a calculated price using the strategy builder.


      Chelsea B.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      111 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      59 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      38 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      42 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      78 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X