Lets you place a stop for the current position(s).
You may have a look at different kind of “SET STOP LOSS” function in the documentation.
Syntax:
1 |
SET STOP LOSS |
Lets you place a stop for the current position(s).
You may have a look at different kind of “SET STOP LOSS” function in the documentation.
Syntax:
1 |
SET STOP LOSS |
Instruction introducing a stop order in x units. Pending orders must be re-placed at each new bar.
Syntax:
1 |
BUY AT x STOP |
Example :
1 2 3 4 5 6 |
myMACD = MACD[12,26,9](close) long = myMACD crosses over 0 IF long THEN BUY 1 LOT AT close+10 STOP ENDIF |
Current profit made by the closed trades of the running strategy.
Syntax:
1 |
myCurrentProfit = STRATEGYPROFIT |
Instruction to set a target order in price format, depending of the point/pip size.
e.g. EURUSD, set a target for 30 pips (point size is 0.0001):
SET TARGET PROFIT 0.0030
Syntax:
1 |
SET TARGET PROFIT x |
Example :
1 2 3 4 5 6 7 8 9 10 |
myMACD = MACD[12,26,9](close) long = myMACD crosses over 0 IF NOT LongOnMarket AND long THEN BUY 1 CONTRACTS AT MARKET ENDIF //set target of positions at 20 points SET TARGET PROFIT 20 |
Ticksize of the instrument (smallest possible variation of price).
Syntax:
1 |
TICKSIZE |
Allows to write conditions and/or declare variables in the selected timeframe (description of the ProBacktest command only on this page).
The syntax of the TIMEFRAME statement is TIMEFRAME (TF, mode) which allows you to put the code in a timeframe different from the main TF, or TIMEFRAME (default) to return to the default TF. “mode” is optional (the default is current bar).
Examples:
1 |
timeframe(5 minutes,updateonclose) |
Designates an order to be executed on the open of the next day.
Syntax:
1 |
AT MARKET TomorrowOpen |
Example :
We are buying 1 contract if conditions of long order are met, tomorrow only, at the open of the market (on new bar appear).
1 2 3 |
IF NOT LongOnMarket AND LongConditions THEN BUY 1 CONTRACTS AT MARKET TomorrowOpen ENDIF |