|
Processing
Main processing algorithm.
virtual bool Processing() |
Return Value
true - trade operation has been executed, otherwise - false.
Note
It does the following steps:
1. Checks the presence of the opened position on the symbol. If there is no opened position, skip steps 2, 3, and 4.
2. Checks conditions to reverse opened position (CheckReverse() method). If position has been "reversed", exit.
3. Checks conditions to close position (CheckClose() method). If position has been closed, skip step 4.
4. Checks conditions to modify position parameters (CheckTrailingStop() method). If position parameters have been modified, exit.
5. Check the presence of pending orders on the symbol. If there is no any pending order, go to step 9.
6. Checks condition to delete order (CheckDeleteOrderLong() for buy pending orders or CheckDeleteOrderShort() for sell pending orders). If the order has been deleted, go to step 9.
7. Check conditions to modify pending order parameters (CheckTrailingOrderLong() for buy orders or CheckTrailingOrderShort() for sell orders). If the order parameters have been modified, exit.
8. Exit.
9. Checks conditions to open position (CheckOpen() method).
If you want to implement your own algorithm, you need to override the Processing() method of the descendant class.
Implementation
//+------------------------------------------------------------------+ |