Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

2-Line Alarm Strategy

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

    2-Line Alarm Strategy

    This programs compiles fine. Sound files work fine outside of program, Set Minimum bar to 1, but does not out put to Log File or Output Window nor does it sound with Speakers on. Prc Variable is well below instrument testing.

    Running on real-time feed from IB.

    protected override void OnBarUpdate()
    {
    // Condition set 1
    Print("Value Checking: " + CurrentBar + " Close: " + Close[0] + " Prc: " + Prc);
    if (Close[0] > Prc)
    {
    Print("Value Checking: " + CurrentBar + " Close: " + Close[0] + " Prc: " + Prc);
    Alert("MyAlert0", Priority.High, "", @"C:\Program Files\NinjaTrader 7\sounds\AlertPrice.wav",2, Color.White, Color.Black);
    PlaySound("AlertSound2.wav");
    PlaySound(@"C:\Program Files\NinjaTrader 7\sounds\AlertRSI.wav");
    PlaySound("AlertATR.wav");
    Print("The Program is working");
    Print(Close[0].ToString("0.00"));
    Log("Action Took Place",NinjaTrader.Cbi.LogLevel.Information);
    }
    }

    #2
    Hi adlane,

    Thanks for the post and welcome to the NT forums.

    If you see no output at all, then maybe the strategy isn't enabled? There is a print statement outside the condition check which should print for each bar. Make sure the strategy is enabled through the right click > Strategies screen.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Worked!

      Thanks! I have toggled a lot indicators to "Enabled" in there Right-Side Pane Parameter Window but just did not think of it for Strategies. Log, First Alert, Print all work now.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      666 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      377 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      110 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      575 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      580 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X