IB TWS Short Trades

When I start my AutoTrade @ 9:30 (Thanks Amibroker for the start time end time code) I use

////////////////////////////////////////////////// INTERACTIVE BROKERS AUTO TRADE ///////////////////////////////////////////

if( EnableAutoTrade == "Yes"  )
{
	_TRACE("InAutoTrade\n");
    if( LastValue( Buy ) )
    {
		_TRACE("LastBuy is true\n");
        if( LastTrade == "Sell" OR LastTrade == ""  )
        {
			_TRACE("Modifying BUY order ID=" + BuyOrderID ); 
            BuyOrderID = ibc.ModifyOrder( BuyOrderID, Name(), "Buy", NQty, "MKT", 0, 0, "Day", Transmit );
            _TRACE("Modify order returned new id=" + BuyOrderID );
            StaticVarSetText( "BuyOrderID", BuyOrderID );
            StaticVarSetText( "LastTrade", "Buy" );
            SetChartBkColor( colorBrightGreen ) ;
        }
    }
	_TRACE("InAutoTrade\n");
    if( LastValue( Sell ) )
    {
		_TRACE("LastSell is true\n");
        if( LastTrade == "Buy" OR LastTrade == ""  )
        {
			_TRACE("Modifying SELL order here ID=" + SellOrderID ); 
            SellOrderID = ibc.ModifyOrder( SellOrderID, Name(), "Sell", NQty, "MKT", 0, 0, "Day", Transmit );
            _TRACE("Modify order returned new id=" + SellOrderID );
            StaticVarSetText( "SellOrderID", SellOrderID );
            StaticVarSetText( "LastTrade", "Sell" );
            SetChartBkColor( colorRed ) ;
        }
    }
    
}

else if( Reset ) 
{ 
StaticVarSetText("BuyOrderID",""); 
if( BuyPending ) ibc.CancelOrder( BuyOrderID ); 
StaticVarSetText("SellOrderID",""); 
if( SellPending ) ibc.CancelOrder( SellOrderID ); 
StaticVarSetText("LastTrade", ""); 
ibc.CloseAllOpenPositions(); 
} 
LastTWSMsg = ibc.getLastError( 0 ); 
BuyStatus = WriteIf( BuyPending, BuyOrderID+", Status: "+BuyStatus,""); 
SellStatus= WriteIf( SellPending, SellOrderID+", Status: "+SellStatus,""); 

////////////////////////////////////////////////// OptimizeD STOPS  ////////////////////////////////////////////////////////////

Trying to figure out how to start with x quantity of shares & double that position so the NQTY (Share Quantity in the ibc.modifyOrder) will reverse the long position to short - in other words I start the day with 100 shares I need to sell 200 to go short 100 but the NQTY is a param so I manually have to change it at the start of the day to initiate - Thoughts? - Thank you. -