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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      67 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      36 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      59 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X