PlaceOrderAssoc( <Broker>, <OrderType>, <Symbol>, <LimitPrice> );
| <Broker> | The selected Broker to fire the order to |
| <OrderType> | ""LIMIT" or "STOP" |
| <Symbol> | The symbol you want to associate this order with |
| <LimitPrice> | The selected LIMIT/STOP PRICE for this order |
This function places a new order to the selected broker with the selected parameters. Users should then use the following MTS functions..
ModifyOrderAssoc() to modify this ASSOC order
getorderstatus() to get/verify the order status
GetFillPrice() to get the fill price of the order
GetFillAmount() to get the # of filled shares/contracts of the order
Cancel() to properly cancel the order
GetCurrentPosition() to verify the current position of the trading system
Return Values:
| OrderID | MTS returns a valid OrderID for any succesfully submitted order |
| < 0 | MTS returns a NEGATIVE NUMBER for any REJECTED order |
Examples:
var GAINMultiplier = 100000;
var DefEntryContracts = 1;
StpEntryOrderID = mentts.call("PlaceOrderAssoc","GAIN","STOP","GBP/USD",nStopPrice);
This command places a STOP order (associated to an entry order) at "nStopPrice".
PTEntryOrderID = mentts.call("PlaceOrderAssoc","GAIN","LIMIT","GBP/USD",nPTPrice);
This command places a LIMIT (ProfitTarget) order (associated to an entry order) at "nPTPrice".