Definition
Generates a buy stop order to enter a long position.
Method Return Value
An IOrder read-only object that represents the order. Reserved for experienced programmers, additional information can be found within the Advanced Order Handling section.
Syntax
EnterLongStop(double stopPrice)
EnterLongStop(double stopPrice, string signalName)
EnterLongStop(int quantity, double stopPrice)
EnterLongStop(int quantity, double stopPrice, string signalName)
The following method variation is for experienced programmers who fully understand Advanced Order Handling concepts.
EnterLongStop(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double stopPrice, string signalName)
Parameters
signalName
|
User defined signal name identifying the order generated. Max 50 characters.
|
stopPrice
|
The stop price of the order.
|
quantity
|
Entry order quantity.
|
liveUntilCancelled
|
The order will NOT expire at the end of a bar, but instead remain live until the CancelOrder() method is called or its time in force has been reached.
|
barsInProgressIndex
|
The index of the Bars object the order is to be submitted against. See the BarsInProgress property. This determines what instrument the order is submitted for.
|
Examples
protected override void OnBarUpdate()
{
if (CurrentBar < 20)
return;
if (BarsSinceEntry() > 10 && CrossAbove(SMA(10), SMA(20), 1))
EnterLongStop(GetCurrentAsk() + TickSize, "SMA Cross Entry");
}
|
|
Tips (also see Overview)
• | If using a method signature that does not have the parameter quantity, the order quantity will be taken from the quantity value set in the strategy dialog window when running or backtesting a strategy |
|