Pop up msg

Questions about MultiCharts .NET and user contributed studies.
d0ke
Posts: 6
Joined: 05 May 2014
Been thanked: 1 time

Pop up msg

Postby d0ke » 03 Mar 2017

Are there anyways to pop up a msg with Yes/No buttons from your strategy running in Portfolio Trader and read which button user clicked?

d0ke
Posts: 6
Joined: 05 May 2014
Been thanked: 1 time

Re: Pop up msg

Postby d0ke » 05 Mar 2017

This may help if you want a trader have a quick discretion:

Code: Select all

using System.Windows.Forms; // add that to header so u can access following

protected override void CalcBar(){
if (Bars.Close[1] == Bars.Open[1]) //insert your condition here, that is just example condition to test
{
if (MessageBox.Show("Do u want to sell half?", "Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
// user clicked yes
sell_market.Send(StrategyInfo.MarketPosition/2); //selling half
}
else
{
// user clicked no
}
}
}
However didn't test that code in the Portfolio Trader window.


Return to “MultiCharts .NET”