Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

same logic block only several lines are executed using the strategy builder

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

    same logic block only several lines are executed using the strategy builder

    I am using the strategy builder to build a simple strategy each set only execute some conditions but other conditions in the same logic block are not executed.

    for example,

    // Set 1
    if (CrossAbove(MACD1.Default, MACD1.Avg, 1))
    {
    MACDCrossUp = true;
    Draw.ArrowUp(this, @"plotMACDSto Arrow up_3", true, 0, (Low[0] + (-3 * TickSize)) , Brushes.Lime);
    Log(@"MACD Cross above", Cbi.LogLevel.Information);
    Log(Convert.ToString(new TimeSpan(21, 25, 0)), Cbi.LogLevel.Information);
    }

    Don't see Log() be executed though the script been running over 8 hours.

    See the attached codes and the screenshot.

    the entire generated codes can be retrieved from https://drive.google.com/file/d/17tT...ew?usp=sharing

    #2
    Hello sysmatrix.

    You should use Print() Statement instead of Log(). In Ninjatrader Help it's stated that:

    "Log events do NOT process to the NinjaScript output window. For temporary logging, please see the Print() method and Output window.​"

    ( https://ninjatrader.com/support/help...h.html?log.htm )

    Comment


      #3
      Hello sysmatrix,

      Thank you for your patience.

      As KonstantinosNT has mentioned, Print() statements would be more appropriate for creating output and debugging your strategy as opposed to Log(). Log() would create entries that show on the Log tab of the Control Center, where Print() creates output that shows in the NinjaScript Output window. For more information about using prints in your scripts, including a video demonstrating how to add prints in the Strategy Builder, please see the following post:


      Please let us know if we may be of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X