This strategy closes the position once the opposite signal has been emitted by the system. It will will close a long position on a sell signal and close a short position on a buy signal.
The arguments taken by this object are special. The first argument is the name of a TradeFilter to use as the condition. It may be followed by argument to give to the TradeFilter at creation time. After that, there's the name of the real CloseStrategy to apply. This strategy will only be applied if the trade filter accepts a fake "close order".
Examples or arguments :
...->new("TF:AroonTrend", "CS:Stop:SAR"); ...->new("TF:FollowTrend", 15, "CS:Stop:SAR", 0.05, 0.02, 0.02);
The system detects the end of the arguments of the TradeFilter once it detects "CS:" or "CloseStrategy:" at the beginning of the next argument.