I am able to change the text without issue if I attach the assignment command to a button. In the snippet below, you can see that I'm trying to change the textbox.text whenever a position change results in "flat". The PrintTo works every time as intended. The myPositionSize.Text assignment command works, but ONLY when I'm NOT using an ATM. This is weird because the ATM will print to the output window, it just won't change the text box. There is nothing else in the source set to overwrite the text and there is no default text set in the xaml file. Why would the textbox not change after an ATM flattens the position, but changes the text if I close the position using a market order button?
private void OnPositionUpdate(object sender, PositionEventArgs e)
{
if(e.MarketPosition==MarketPosition.Flat){
NinjaTrader.Code.Output.Process(nextPositionQty, PrintTo.OutputTab1);
myPositionSize.Text="test";
}
.
.
.
.
Comment