Pop up msg
Pop up msg
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?
Re: Pop up msg
This may help if you want a trader have a quick discretion:
However didn't test that code in the Portfolio Trader window.
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
}
}
}