I will show you how you can easily code a message box pop-up window to show trade alerts in an indicator using Microsoft C# and the cTrader platform. The block of code below uses the method to display the popup box.
MessageBox.Show("hello");
namespace cAlgo
{
[Indicator(AccessRights = AccessRights.None)]
public class messagetest : Indicator
{
[Parameter(DefaultValue = "Hello world!")]
public string Message { get; set; }
[Output("Main")]
public IndicatorDataSeries Result { get; set; }
protected override void Initialize()
{
MessageBox.Show("hello, this is a test", "MESSAGE TEST", MessageBoxButton.OKCancel, MessageBoxImage.Information);
}
public override void Calculate(int index)
{
// Calculate value at specified index
// Result[index] =
}
}
}