Hi,

Until yesterday the following code reported correctly short and long
positions. Now is sending orders even if position is negative. Any clues?

if( Position > 0 )

              Sz= ibc.getpositionsize(Name());

          {

                     // retrieve orderID from previous run, will be empty if
no order was placed before   

              stopOrderID = StaticVarGetText("OrderID"+Name()); 

 

                     // place or modify the order - don't transmit yet 

              OrderID = ibc.ModifyOrder( OrderID, Name(), "SELL", sz*2,
"LMT", Prss, 0, "Day", True );

 

              // store orderID for next run so we know which order to modify


              StaticVarSetText("OrderID"+Name(), OrderID); 

              } 

 

Reply via email to