Documentation / ProBacktest

Set a stop loss x points from the average position price.

Points of the current instrument is equal to POINTSIZE

Syntax:

 

Example :

 

Size of a pip (or point), PipSize=PointSize.

Syntax:

 

Value in €/$ of one pip (or one point) in the currency of the instrument. PipValue=PointValue.

Syntax:

 

Indicates the percent of gain or loss of the Nth previous position.

The instruction POSITIONPERF(n) returns: The performance (ratio gain/cost of the position) of the n-th last position closed if n>0 (not including brokerage fees) The performance (ratio gains/cost of the position) of the currently open position if n=0 (not including brokerage fees)

If n is not specified, we suppose that n=0. PositionPerf=PositionPerf(0).

Syntax:

 

Indicates the current average position price of the whole opened orders.

If you open 3 positions, respectively at 5$, 10$ and 15$, POSITIONPRICE is : (5+10+15)/3 = 10€.

Syntax :

POSITIONPRICE can also be used to get the previous average position price in the last candle period with offset :

 

Example :

Floating profit of the whole opened orders

 

Averaging down simple trading strategy example :

 

Set a target profit of x points/pips of the current instrument.

Price unit is equal to POINTSIZE

(more…)

Sets the maximum amount of bars preloaded for the calculation of indicators used in a trading system.

Syntax:

This instruction is very useful if you plan to use indicators that need previous bar to compute before you can rely on them to make trading decisions in your code.

(more…)

The PRICE statement is used in both SET STOP and SET TARGET, to set respectively the stoploss or takeprofit at a defined price level.

(more…)

Set a target profit of x units of the current instrument.

Price unit is equal to POINTSIZE

(more…)

Instruction used to stop a trading system. All opened, stop and limit orders are close when the instruction is used.

Stopped strategy with the QUIT instruction cannot be re-launched automatically by code. Only a manual intervention can do it.

Syntax:

 

Example1 :

Stop the automated trading program at 22:00 if we are short on market.

 

Example2 :

Stop the strategy if the actual profit is losing 200 of the money account.

 


Top