Stop loss and profit target strategies can be created in two ways:
Stop loss and/or traget profit parameters must be set on every calculation step.
To set Stop Loss and Profit Target use following functions:
SetStopLoss(double amount) // amount specifies Stop Loss value SetTargetProfit(double amount) // amount specifies Target Profit value SetStopPerPosition(bool perPosition) // if perPosition is set to True stops are calculated on per position basis // if it's set to False stops are calculated on per share/contract basis
Stop loss and profit target can be active simultaneously.
Warning! All stop loss/profit target parameters are global to symbol chart and therefore if they are set in many strategies applied on the chart last value will be used.
Set Initial Calculation property to True in strategy properties to be shure that stop loss/profit target parameters are active before other strategies will be executed. See Analysis Technique Properties for details.