- Init
- Magic
- InitSignal
- InitTrailing
- InitMoney
- InitTrade
- Deinit
- OnTickProcess
- OnTradeProcess
- OnTimerProcess
- OnChartEventProcess
- OnBookEventProcess
- MaxOrders
- Signal
- ValidationSettings
- InitIndicators
- OnTick
- OnTrade
- OnTimer
- OnChartEvent
- OnBookEvent
- InitParameters
- DeinitTrade
- DeinitSignal
- DeinitTrailing
- DeinitMoney
- DeinitIndicators
- Refresh
- Processing
- SelectPosition
- CheckOpen
- CheckOpenLong
- CheckOpenShort
- OpenLong
- OpenShort
- CheckReverse
- CheckReverseLong
- CheckReverseShort
- ReverseLong
- ReverseShort
- CheckClose
- CheckCloseLong
- CheckCloseShort
- CloseAll
- Close
- CloseLong
- CloseShort
- CheckTrailingStop
- CheckTrailingStopLong
- CheckTrailingStopShort
- TrailingStopLong
- TrailingStopShort
- CheckTrailingOrderLong
- CheckTrailingOrderShort
- TrailingOrderLong
- TrailingOrderShort
- CheckDeleteOrderLong
- CheckDeleteOrderShort
- DeleteOrders
- DeleteOrder
- DeleteOrderLong
- DeleteOrderShort
- LotOpenLong
- LotOpenShort
- LotReverse
- PrepareHistoryDate
- HistoryPoint
- CheckTradeState
- WaitEvent
- NoWaitEvent
- TradeEventPositionStopTake
- TradeEventOrderTriggered
- TradeEventPositionOpened
- TradeEventPositionVolumeChanged
- TradeEventPositionModified
- TradeEventPositionClosed
- TradeEventOrderPlaced
- TradeEventOrderModified
- TradeEventOrderDeleted
- TradeEventNotIdentified
- TimeframeAdd
- TimeframesFlags
Processing
Algoritmo de processamento principal.
virtual bool Processing() |
Valor de retorno
Verdadeiro se a operação de negociação foi executada, caso contrário falso.
Observação
Ele faz as seguintes etapas:
1. Verificar a presença da posição aberta no símbolo. Se não abrir a posição, pule as etapas №2, №3 e №4.
2. Verificar condições para reversão da posição aberta (método CheckReverse()). Se a posição foi revertida, sair.
3. Condições para verificar o fechamento da posição (método CheckClose()). Se a posição foi fechada, pule a etapa №4.
4. Verificar as condições para modificar os parâmetros da posição (método CheckTrailingStop() ). Se os parâmetros da posição foi modificado, sair.
5. Verificar a presença de ordens pendentes no símbolo. Se não houver qualquer ordem pendente, vá para a etapa №9.
6. Verificar condição para excluir a ordem (CheckDeleteOrderLong() para ordens pendentes de compra ou CheckDeleteOrderShort() para ordens pendentes de venda). Se a ordem foi excluída, vá para a etapa №9.
7. Verificar as condições para modificar parâmetros de ordem pendente (CheckTrailingOrderLong() para ordens de compra ou CheckTrailingOrderShort() para ordens de venda). Se os parâmetros de ordem foram modificados, sair.
8. Sair.
9. Verificar condições para abertura de posição (método CheckOpen()).
Se você quiser implementar seu próprio algoritmo, você precisará substituir o método da classe herdeira Processing() .
Implementação
//+------------------------------------------------------------------+ |