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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      53 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      130 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      70 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      44 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