A quick reference guide to Control Tower’s syntax for your PineScript alerts. Refer to our full documentation for detailed descriptions and examples.
ARGUMENT |
DESCRIPTION |
EXAMPLE |
---|---|---|
|
A string identifying the product registered with your license. Default is “f1”. Required. |
productID:f1 |
|
A string containing the chart symbol you wish to trade. Required. |
symbol:EURUSD |
|
An integer of the number of standard lots you wish to trade. Required. |
lots:0.4 |
|
An integer of the percentage of your account equity you wish to trade. Required. |
risk:2 |
|
An integer of the price where you want to place the stop loss. |
stopLoss:1.12 |
|
An integer of the price where you want to place the take profit. Required. |
takeProfit:2.34 |
|
An integer assigning a Magic Number to the order which is useful if multiple positions have been opened on the same symbol. |
magicNumber:1234 |
|
An integer of the price where you want the order to execute. |
openPrice:1.34 |
|
An integer used with LongExit or ShortExit. This is the percentage of your position you want to exit at the specified takeProfit price. |
closePercentage:25 |
|
A string containing one of 9 options of trade order types. Required. |
action: see below |
The action
argument has specific values which can be used:
action VALUES |
DESCRIPTION |
EXAMPLE |
---|---|---|
|
Used for placing opening market orders long. |
action:LongEntry |
|
Used for placing opening market orders short. |
action:ShortEntry |
|
Used for placing closing market orders which are long. |
action:LongExit |
|
Used for placing closing market orders which are short. |
action:ShortExit |
|
Used for setting limit orders in the long direction. |
action:buyLimit |
|
Used for setting limit orders in the short direction. |
action:sellLimit |
|
Used for setting a long stop-limit order. |
action:buyStop |
|
Used for setting a short stop-limit order. |
action:sellStop |
|
Used for changing parameters of an open position, specifically stopLoss and takeProfit. |
action:modifyOrder |