Change()

<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Add On > Account >

Change()

Previous page Return to chapter overview Next page

Definition

Changes specified Order object(s).

 

Syntax

Change(IEnumerable<Order> orders)

 

Parameters

orders

Order(s) to change

 

 

Example

ns


Order stopOrder;
stopOrder.StopPriceChanged = stopOrder.StopPrice - 4 * stopOrder.Instrument.MasterInstrument.TickSize;

 

private void OnExecutionUpdate(object sender, ExecutionEventArgs e)
{
  // Change the stop order if an execution results in a long position
  if(e.MarketPosition == MarketPosition.Long)
      myAccount.Change(new[] { stopOrder });
}