I have created a strategy with some custom trade buttons in the trade panel.
The Code for the event is the following:
protected void ScalperLongClick(object sender, RoutedEventArgs e)
{
TriggerCustomEvent(o =>
{
//find the lowest low for scalper long
int lowestBar = LowestBar(Low, 5);
double low = Low[lowestBar];
double high = High[lowestBar];
//Draw.ArrowUp(this, CurrentBar+"", false,lowestBar, Low[0]-TickSize*5, Brushes.Green);
EnterLongStopMarket(0,true, 1,high + TickSize * 5, CurrentBar+"SuperLong");
SetStopLoss(CalculationMode.Price,low - TickSize * 1);
SetProfitTarget(CalculationMode.Price,high + TickSize * 19);
Draw.Line(this, CurrentBar + "Entry", 1, high + TickSize * 5, -1, high + TickSize * 5, Brushes.Orange);
Draw.Line(this, CurrentBar + "SL", 1, low - TickSize * 1, -1, low - TickSize * 1, Brushes.Orange);
ForceRefresh();
}, null);
}
After one of those are hit I can do the same again and it works as expected.
The issue I get is if I press the button and generate the order but then after a while cancel the order by clicking the little x on the order on the chart.
After that I cannot generate any new orders by pressing the button. I need to reload Ninjascript and then it works again.
Is there any way to fix that behavior ?

Comment