Indicates whether you have open long positions or not.
Syntax:
1 |
LONGONMARKET |
Example :
1 2 3 |
IF NOT LongOnMarket THEN BUY 1 LOT AT MARKET TomorrowOpen ENDIF |
Indicates whether you have open long positions or not.
Syntax:
1 |
LONGONMARKET |
Example :
1 2 3 |
IF NOT LongOnMarket THEN BUY 1 LOT AT MARKET TomorrowOpen ENDIF |
Allows to know if a Long position has been opened on the candlestick N (N optional by default at 0). (more…)
Set a stop loss x units from the average position price.
Syntax:
1 |
Set STOP LOSS x |
Example :
1 2 3 4 5 6 7 8 9 |
myMACD = MACD[12,26,9](close) long = myMACD crosses over 0 IF NOT LongOnMarket AND long THEN BUY 1 CONTRACTS AT MARKET ENDIF //set stop loss at 50 pips from the average position price (on a 5 digits instrument) SET STOP LOSS 0.0050 |
Define the number of lots to buy or sell (equivalent to “SHARE”).
Syntax:
1 |
LOT |
Example :
1 2 3 4 |
IF NOT ONMARKET AND validsetup THEN BUY 1 LOT AT MARKET NextBarOpen ENDIF |
Designates an order to be launch directly at market price.
Syntax :
1 |
MARKET |
Example :
1 |
BUY 2 SHARES AT MARKET |
Designates an order to be executed on the open of the next bar.
Syntax:
1 |
AT MARKET NextBarOpen |
Example :
1 2 3 |
IF NOT ONMARKET THEN BUY 2 CONTRACTS AT MARKET NextBarOpen ENDIF |
Allows backtests to not update their initial capital with gains and losses (instruction for backtests only).
Syntax:
1 |
DEFPARAM NOCASHUPDATE=true/false |
Indicates whether or not a position is open.
Syntax:
1 |
ONMARKET |
Example :
1 2 3 |
IF NOT ONMARKET THEN BUY 1 CONTRACTS AT MARKET ENDIF |
Size of a pip (or point), PipSize=PointSize.
Syntax:
1 |
PipSize |
Value in €/$ of one pip (or one point) in the currency of the instrument. PipValue=PointValue.
Syntax:
1 |
PipValue |