Alert Popup Window

by Ahmad Noman Musleh in category Other at 25/10/2017
Description

Its a library for cTrader indicators and cBots to show a popup alert window, you can use it on your custom indicators and cBots.

Your indicator/cBot user will be able to select the alert sound file or enable/disable it without any coding effort by you.

You will be able to add popup, sound, email, and Telegram alert on your indicator/cBot with a single line of code!

Its free and open source, any kind of contribution is welcome!

Features

  • Easy to use
  • WPF window instead of Windows Forms
  • Multiple themes and accents
  • Removing alerts
  • Playing sound and allowing the user to select the sound file via Windows Explorer
  • Email alert
  • Changing time zone and format
  • Telegram Bot Alert

 

Github: https://github.com/afhacker/ctrader-alert_popup

Documentationhttps://github.com/afhacker/ctrader-alert_popup/wiki

 

 

Download
1979 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
    {
        protected override void Initialize()
        {
            // Please use the above full sample code instead
        }

        public override void Calculate(int index)
        {
        }
    }
}
Comments

hamidrta fx - October 30, 2017 @ 23:21

thanks.

iam set for my indicator but not show alert window?whay?

https://ctdn.com/forum/indicator-support/11992

Ahmad Noman Musleh - October 31, 2017 @ 04:33

hamidreza.taali@gmail.com,

Your indicator access rights are set to "None", change it to full access.

And you are using the old alert library use the WPF version instead.

hamidrta fx - October 31, 2017 @ 15:07

thanks.
i am update my indicator but not show popup again.

can you see my topic an help me?please.

hamidrta fx - November 01, 2017 @ 11:32

thanks.

 

i am update my indicator.
but not working popup agian.

Ahmad Noman Musleh - November 02, 2017 @ 09:31

hamidreza.taali@gmail.com

I lost your forum thread link.

hamidrta fx - November 02, 2017 @ 10:27

https://ctdn.com/forum/indicator-support/11992

hamidrta fx - November 02, 2017 @ 19:25

thanks a lot.

buy not working agin?!

Daniel P - January 12, 2018 @ 18:04

Can you make this .dll files to work? Because, until now, I tried everithing and work just for 5 minutes and after that the alerts are just as .csv file writed.

Daniel P - January 12, 2018 @ 18:06

I really need an alert sistem for my trading strategy. The old version is working but it is a little difficult to manage this.

Ahmad Noman Musleh - January 15, 2018 @ 18:07

@Danis

try the new version 1.2

Daniel P - January 15, 2018 @ 21:00

It starting to work, but after 5 min FxPro cTrader crash.

Thanks, anyway, can you fix it?

Daniel P - January 15, 2018 @ 21:01

And the new alert clears the old one, without to make a list of alerts.

Daniel P - January 16, 2018 @ 00:28

Important personal note:

If you can fix it, this library will be for me the most important indicator published in last 2 years. I know very well all indicators and cBots from this site.

Thanks again!

Ahmad Noman Musleh - January 16, 2018 @ 12:25

@Danis

I have fixed the previous versions bugs please test the version 1.3 and let me know the result.

I tested the new version on Windows 10 FxPro cAlgo and it was working fine.

Daniel P - January 16, 2018 @ 12:45

Sorry, but the link to download not exist.

Ahmad Noman Musleh - January 16, 2018 @ 13:10

Link fixed.

Daniel P - January 16, 2018 @ 15:15

Now it´s working, but just for one pair. If you use the same indicator with the alert popup for more pairs, the alert popup message will be opened for each pair, and every popup repeats the alert messages. That make to use all system resources (i5 8GB RAM, stop and CPU 98% and memory 60%).

 

Ahmad Noman Musleh - January 17, 2018 @ 16:50

Test the new version

Daniel P - January 17, 2018 @ 17:39

Now it works, but if you close the popup message windows this will never appear again. You must rebuild the indicator that use allert.dll to start again the popup windows.This is the only one bug.

Thanks for your hard work. I make some indicators, just for personal use, and this one helps me a lot. 

Daniel P - January 17, 2018 @ 17:41

Apropos, do you know a formula for fast MACD calculates?

Ahmad Noman Musleh - January 18, 2018 @ 09:58

the bug in alert library version 1.3.2 fixed, about fast MACD no I don't know how it's calculated.

Daniel P - January 23, 2018 @ 15:40

hI,

First, thanks for your alert library. It's work quite well for me.

I finished a cBot and I want to add a procedure to make optimisation of the parameters before to start the cBot.

Can you help me with this?

Thanks,

Daniel, Vienna

Ahmad Noman Musleh - January 28, 2018 @ 08:50

Sorry, I can't help you with that.

Daniel P - June 06, 2018 @ 15:57

Can you a new version update, more compatible with cTrader3.0?

Thanks,

Daniel P - June 06, 2018 @ 16:10

And also with the option to personalise the email message content

Ahmad Noman Musleh - June 08, 2018 @ 04:54

I will, the new version will have Telegram alert option too.

Daniel P - June 14, 2018 @ 17:29

And when will be ready?

 

Ahmad Noman Musleh - June 15, 2018 @ 05:51

I can't give you an exact date but I will do my best to do it in next few months.

rosemarie.bautista - July 11, 2018 @ 02:40

hi @afhacker, can you help? is there a way for this alert to appear only once per candle? some command that is native only to the Alert namespace? sort of a newbie in coding here.. i used it to alert on a higher timeframe but it keeps on triggering endlessly if the candle is not done yet. many many thanks.

Ahmad Noman Musleh - July 11, 2018 @ 09:21

rosemarie.bautista

If you call the Trigger method with default TriggerType which is Per Bar then the popup should only appear once per each bar even if you call the Trigger method multiple times during time span of a single bar.

rosemarie.bautista - July 13, 2018 @ 16:36

thank you. I have been using the alert for few weeks now but suddenly the alert turned blank. the window comes out but there is no data coming out. i have tried it with the Alert test indicator as well, but it is still the same. any suggestions? Appreciate your help.

Ahmad Noman Musleh - July 14, 2018 @ 07:10

Use cTrader "Automation" and check the cBot / Indicator "Logs" tab, is there any error message?

rosemarie.bautista - July 14, 2018 @ 13:44

here is a sample message, although i am unsure if it was different when the market was live. thank you for looking into it.

14/07/2018 18:39:21.980 | Exception: An unexpected error occurred.
14/07/2018 18:39:21.980 | Exception: An unexpected error occurred.
14/07/2018 18:39:21.996 | Source: CsvHelper
14/07/2018 18:39:21.996 | Source: CsvHelper
14/07/2018 18:39:21.996 | StackTrace:    at CsvHelper.Configuration.Configuration.<>c.<.ctor>b__148_4(CsvHelperException exception)    at CsvHelper.CsvReader.<GetRecords>d__63`1.MoveNext()    at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)    at Alert.Factory.ReadAlerts()
14/07/2018 18:39:21.996 | StackTrace:    at CsvHelper.Configuration.Configuration.<>c.<.ctor>b__148_4(CsvHelperException exception)    at CsvHelper.CsvReader.<GetRecords>d__63`1.MoveNext()    at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)    at Alert.Factory.ReadAlerts()
14/07/2018 18:39:21.996 | TargetSite: Void <.ctor>b__148_4(CsvHelper.CsvHelperException)
14/07/2018 18:39:21.996 | TargetSite: Void <.ctor>b__148_4(CsvHelper.CsvHelperException)
14/07/2018 18:39:21.996 | InnerException: System.FormatException: String was not recognized as a valid DateTime.    at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles, TimeSpan& offset)    at System.DateTimeOffset.Parse(String input, IFormatProvider formatProvider, DateTimeStyles styles)    at CsvHelper.TypeConversion.DateTimeOffsetConverter.ConvertFromString(String text, IReaderRow row, MemberMapData memberMapData)    at lambda_method(Closure )    at CsvHelper.Expressions.RecordCreator.Create[T]()    at CsvHelper.CsvReader.<GetRecords>d__63`1.MoveNext()
14/07/2018 18:39:21.996 | InnerException: System.FormatException: String was not recognized as a valid DateTime.    at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles, TimeSpan& offset)    at System.DateTimeOffset.Parse(String input, IFormatProvider formatProvider, DateTimeStyles styles)    at CsvHelper.TypeConversion.DateTimeOffsetConverter.ConvertFromString(String text, IReaderRow row, MemberMapData memberMapData)    at lambda_method(Closure )    at CsvHelper.Expressions.RecordCreator.Create[T]()    at CsvHelper.CsvReader.<GetRecords>d__63`1.MoveNext()
14/07/2018 18:39:21.996 | Exception: String was not recognized as a valid DateTime.
14/07/2018 18:39:21.996 | Exception: String was not recognized as a valid DateTime.
14/07/2018 18:39:21.996 | Source: mscorlib
14/07/2018 18:39:21.996 | Source: mscorlib
14/07/2018 18:39:21.996 | StackTrace:    at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles, TimeSpan& offset)    at System.DateTimeOffset.Parse(String input, IFormatProvider formatProvider, DateTimeStyles styles)    at CsvHelper.TypeConversion.DateTimeOffsetConverter.ConvertFromString(String text, IReaderRow row, MemberMapData memberMapData)    at lambda_method(Closure )    at CsvHelper.Expressions.RecordCreator.Create[T]()    at CsvHelper.CsvReader.<GetRecords>d__63`1.MoveNext()
14/07/2018 18:39:21.996 | TargetSite: System.DateTime Parse(System.String, System.Globalization.DateTimeFormatInfo, System.Globalization.DateTimeStyles, System.TimeSpan ByRef)
14/07/2018 18:39:21.996 | StackTrace:    at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles, TimeSpan& offset)    at System.DateTimeOffset.Parse(String input, IFormatProvider formatProvider, DateTimeStyles styles)    at CsvHelper.TypeConversion.DateTimeOffsetConverter.ConvertFromString(String text, IReaderRow row, MemberMapData memberMapData)    at lambda_method(Closure )    at CsvHelper.Expressions.RecordCreator.Create[T]()    at CsvHelper.CsvReader.<GetRecords>d__63`1.MoveNext()
14/07/2018 18:39:21.996 | TargetSite: System.DateTime Parse(System.String, System.Globalization.DateTimeFormatInfo, System.Globalization.DateTimeStyles, System.TimeSpan ByRef)

rosemarie.bautista - July 16, 2018 @ 09:40

it has the same error in live conditions. appreciate your help/input on how I can solve this.

Ahmad Noman Musleh - July 17, 2018 @ 12:31

rosemarie.bautista 

I will test it on Friday and then let you know the result.

Ahmad Noman Musleh - July 20, 2018 @ 12:45

rosemarie.bautista 

Test the new version and let me know if there was any issue.

rosemarie.bautista - July 20, 2018 @ 17:17

Hi. I tested it on your Test script as above, and there was an error upon building it. Thank you so much.

Error CS0117: 'Alert.Factory' does not contain a definition for 'Indicator'

rosemarie.bautista - July 20, 2018 @ 17:41

Hi, apologies. I tried the above again using .Algo, but I still got the blank screen. The build succeeded though.

Ahmad Noman Musleh - July 20, 2018 @ 18:15

Delete the alerts CSV file, it's inside cAlgo folder in your documents.

Is it returning the same error message in logs?

Ahmad Noman Musleh - July 20, 2018 @ 18:46

Did you reference "ControlzEx.dll" file?

rosemarie.bautista - July 21, 2018 @ 09:33

yes I did reference it to ControlzEX.dll. It is still having the same error message in logs.

I could not find the alerts CSV file you mentioned. am I not checking the correct folder? I tried searching the whole folder but no file was found.

thanks for your patience.

Ahmad Noman Musleh - July 21, 2018 @ 14:11

Alerts File Path: \Documents\cAlgo\alerts.csv

I made some changes, re-download the DLL files and try again.

Can you tell me what's your system language? culture setting?

rosemarie.bautista - July 21, 2018 @ 15:14

Appreciate your help a lot. i have tried the Test script above and the alert was good. I also tried re-installing my cTrader, but I don't know if that helped. WIll test with my indicator again once the market is live and will let you know. Have a great weekend! Bless you!

rosemarie.bautista - July 23, 2018 @ 19:18

everything seems fine. thanks a lot for your help.. and this great indicator.

Vince - August 02, 2018 @ 15:39

Hello afhacker,

I created an indicator and referenced to this thread in my discription for adding alerts to the indicator. If you do not want you referenced please say so and I will remove it.

https://ctrader.com/algos/indicators/show/1775

Thank you for creating this amazing project!

Kind regards,

Vince

Ahmad Noman Musleh - August 02, 2018 @ 17:50

Vince

Its free and open source, I developed it for cTrader users and there is no need to ask me for permission or anything else.

clloyd - September 05, 2018 @ 13:48

Hi afhacker,

Fantastic Indicator and thankyou very much for sharing. I am having a little trouble rebuilding the solution int VStudio though. All references nuGet and dependencies are clean. But I have these two errors I cant resolve. 

1/ From the Core.Factory CS0246  C# The type or namespace name 'MainWindow' could not be found (are you missing a using directive or an assembly reference?)

and

2/ Also Core.Factory CS0118  C# 'Alert' is a namespace but is used like a type.

Apologies for asking. If this is to complex don't worry. I will persist and advise on success. 

 

Regards

 

 

Ahmad Noman Musleh - September 05, 2018 @ 18:15

clloyd.

The master branch contains the new version of the library which is under development and not released yet.

The current version is in branch 1.0 so clone that branch not the master and try to rebuild it.

In case you want to use the version 2.0 which is under development re-clone the master branch and try to build it again. 

clloyd - September 06, 2018 @ 00:24

Thanks AFhacker, That worked perfectly! Still working on my Git skills. Thanks again. 

kethel - September 06, 2018 @ 10:10

i'm stuck with ctader 3.0, why it can't build?

i am sorry, i'm noob here

Ahmad Noman Musleh - September 06, 2018 @ 16:00

erk86,

Check the log tab of cTrader => Automate and if there was any error message post it here, then I will be able to help you.

Daniel P - October 13, 2018 @ 09:32

Hi,

 Can you the new version (with mods from GitHub) compile?

I can't compile the GitHub project (dependence errors)

Thanks

Ahmad Noman Musleh - October 13, 2018 @ 17:29

Danis

The new version isn't finished yet, I will release it in the next few days with some really cool features like Telegram bot alert.

Daniel P - October 14, 2018 @ 03:54

Super cool

I use your alert popup togheter with a telegram routine in one robot. It works well!

Daniel P - October 14, 2018 @ 03:56

And a suggestion

In time column add the option also for day (usefull for long term trade to see also the day not just the time of alert)

Ahmad Noman Musleh - October 14, 2018 @ 08:36

Danis

In new version time column shows full date time, not just time, and you can show/hide columns, change columns size, and sort alerts based on all columns and it will remember all your changes.

Two new columns added, Price and Triggered By.

As you asked in the new version you can fully change the email subject/body and telegram message templates by using template keywords.

The thing I'm struggling with is avoiding multi popup opening with pipe server, that's the hard part and I'm doing my best to find a solution for it.

There is an issue on cTrader indicator initialization process, sometimes the indicator code executed twice upon initialization and it causes lots of issues for those indicators that show a window, I reported the issue and they said it will be fixed in November release.

Once I finished the pipe server issue and tested it fully I will release it.

The new version will be on Nugget so you will be able to install it from Visual Studio Nugget console or package manager.

Another major change is using cAlgo API INotifications interface for showing the popup, the popup show method is implemented as an extension method to INotifications interface so to show the popup you do this:

Notifications.ShowPopup(...);

Same like play sound and send email methods.

And you don't need to set your indicator/cBot to alert library on Initialize/OnStart method unless you need debugging info.

The new version code is written fully in MVVM pattern.

Ahmad Noman Musleh - October 19, 2018 @ 11:04

Ok its here

Daniel P - October 22, 2018 @ 13:09

Hi,

very good work

I have trouble with Telegram settings. The alert Popup crashed after I inserted the username and cBot Key.

Can you check this?

Thanks,

Ahmad Noman Musleh - October 22, 2018 @ 13:22

Danis;

Did you installed the latest version of cAlgo.API.Alert.UI (2.0.1.1) package?

Ahmad Noman Musleh - October 22, 2018 @ 19:10

Danis,

I have uploaded the new version DLL files to Google drive folder, download the new version DLL files

Daniel P - October 24, 2018 @ 12:51

OK, now everything's is working.

Thanks!

cleboldetrich - February 18, 2019 @ 12:56

Hi Ahmad, is the bot still available? The downloaded file is a blank one.

Regards,

cleboldetrich

alex_mihail - February 19, 2019 @ 01:28

Is it possible to set a different alert sound for each alert triggered?

Also having trouble getting my Telegram bot connected - when I paste the name and key in the alert window crashes.

Ahmad Noman Musleh - February 19, 2019 @ 19:38

cleboldetrich

It's not a bot, it's a library that allows you to show a popup window from your cTrader cBots or indicators.

Ahmad Noman Musleh - February 19, 2019 @ 19:40

alex_mihail

No, it is not possible to set different sound files.

Regarding the Telegram issue, I will release a new version ASAP.

Ahmad Noman Musleh - February 28, 2019 @ 09:45

alex_mihail

Telegram issue has been fixed.

Daniel P - March 16, 2019 @ 09:20

Error when I try to load source inVStudio from Github

[Package source] The V2 feed at 'https://github.com/afhacker/ctrader-alert_popup/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net45'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '404 Not Found'.

 

Daniel P - March 16, 2019 @ 09:23

[Package source] The V2 feed at 'https://github.com/afhacker/ctrader-alert_popup/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net45'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '404 Not Found'.
[Package source] The V2 feed at 'https://github.com/afhacker/ctrader-alert_popup/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net472'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '404 Not Found'.
[Package source] The V2 feed at 'https://github.com/afhacker/ctrader-alert_popup/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net472'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '404 Not Found'.
[Package source] The V2 feed at 'https://github.com/afhacker/ctrader-alert_popup/Search()?$filter=IsLatestVersion&searchTerm='cAlgo.API.Alert'&targetFramework='net472'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '404 Not Found'.
[Package source] The V2 feed at 'https://github.com/afhacker/ctrader-alert_popup/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net35'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '404 Not Found'.
[Package source] The V2 feed at 'https://github.com/afhacker/ctrader-alert_popup/Search()?$filter=IsLatestVersion&searchTerm=''&targetFramework='net35'&includePrerelease=false&$skip=0&$top=26&semVerLevel=2.0.0' returned an unexpected status code '404 Not Found'.

 

Ahmad Noman Musleh - March 16, 2019 @ 18:59

Daniel P

Open the Github repo page and then click on "Clone" button, then select the "Open in Visual Studio".

It worked fine for me, you can also download the repo as a zip and then open it with VS.

5