Alert Window

by afhacker in category Other at 04/08/2016

As you know cAlgo & cTrader API doesn't has any type of built in alert window feature so I made this library for indicator developers who want to add an alert window on their indicators, Below is short tutorial of how to use this library.

Moved to:

New Version Changes:

  • The classic Windows UI changed to Metro
  • Alerts list control changed from ListView to DataGridView
  • Now you can limit the number of alerts
  • Top most window bug fixed


How to use Alert Window:
1. Use cAlgo reference manager and add "Alert.dll", "MetroFramework.dll", "MetroFramework.Design.dll", and "MetroFramework.Fonts.dll" DLL files to your indicator:


2. Set the indicator access right to " FullAccess":

    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]

3. Add the "AlertWindow"  and "System.Threading.Tasks" name spaces on top of your indicator code by adding:

using System.Threading.Tasks;
using AlertWindow;

4. Make an instance of "Alert" class:

private Alert _alarm;

protected override void Initialize()
	// The class constructor receives three parameters, Indicator name and symbol code
        // And Maximum number of alerts(it's optional and default value is 12)
	_alarm = new Alert("Your Indicator Name As String", Symbol.Code);

5. Now you can trigger an alert by calling "Trigger" method of "Alert" class, This method get two parameters:

// You should use C# Task for running the code asynchronously
// Signal Type can be buy and sell or long and short(string)
// Server.Time is the time of signal(event) occurrence.
Task showForm = Task.Factory.StartNew(() => { _alarm.Trigger(SignalType, Server.Time); });


Alert Window:




How to install
Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
using AlertWindow;
using System.Threading.Tasks;

namespace cAlgo
    [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
    public class AlertTest : Indicator
        private Alert alert;

        private int signalIndex = 0;

        protected override void Initialize()
            alert = new Alert("Test Indicator", Symbol.Code);

        public override void Calculate(int index)
            if (IsLastBar && IsRealTime && signalIndex != index)
                string signalType = string.Empty;

                if (MarketSeries.Close.Last(1) > MarketSeries.Open.Last(1))
                    signalType = "Buy";
                else if (MarketSeries.Close.Last(1) < MarketSeries.Open.Last(1))
                    signalType = "Sell";

                Task showForm = Task.Factory.StartNew(() => { alert.Trigger(signalType, Server.Time); });

            signalIndex = index;


newbee - September 04, 2016 @ 12:13

Hello afhacker,

love your work. any chance of supplying a link to download the dll files listed above (ie  "Alert.dll", "MetroFramework.dll", "MetroFramework.Design.dll", and "MetroFramework.Fonts.dll" DLL ) that are needed for this indicator? Tried finding and downloading them myself but they end up being incorrect stating incorrect format etc. Appreciate any assistance to get these so I can add them to reference manager as stated above. Thanks 

afhacker - September 04, 2016 @ 18:53


You can get metro framework files from their site by installing it via "NuGet" or downloading it from their GitHub:

And for "Alert.dll" file:

newbee - September 05, 2016 @ 00:04

Thank you very much.