Alert Window

by afhacker in category Other at 04/08/2016
Description

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.

 

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. Add the "AlertWindow"  and "System.Threading.Tasks" name spaces on top of your indicator code by adding:

using System.Threading.Tasks;
using AlertWindow;

3. 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);
}

4. 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:

 

GitHub:

https://github.com/afhacker/Alert-Window

Example:

http://ctdn.com/algos/show/1371

BitCoin: 1Me2TQ6Rgr8EevZNFKqvYegkbtY8C2cP5i

Download
501 downloads
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;

namespace cAlgo
{
    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class Blank : Indicator
    {
        [Parameter(DefaultValue = 0.0)]
        public double Parameter { get; set; }

        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }


        protected override void Initialize()
        {
            // Initialize and create nested indicators
        }

        public override void Calculate(int index)
        {
            // Calculate value at specified index
            // Result[index] = ...
        }
    }
}
Comments

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

@newbee

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

http://dennismagno.github.io/metroframework-modern-ui/

And for "Alert.dll" file:

https://github.com/afhacker/Alert-Window/tree/master/Alert/bin/Release

newbee - September 05, 2016 @ 00:04

Thank you very much.

0