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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      66 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      149 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X