Timeframe

 
Como definir um timeframe específico ao iniciar o EA?
 
Forex ou Bmf? Minha humilde opinião é que pra ser consistente e rentável Time de 15 min a 60 é o ideal. Isso tira o ruído e possibilita ganhos melhores. Pra forex me interesso em h4, porém não opero muito lá.
 
superhallex:
Forex ou Bmf? Minha humilde opinião é que pra ser consistente e rentável Time de 15 min a 60 é o ideal. Isso tira o ruído e possibilita ganhos melhores. Pra forex me interesso em h4, porém não opero muito lá.

Meus testes estão sendo no servidor do Forex.

Estou iniciando a programar no MQL5, queria entender como setar uma timeframe via algorítimo.

Obrigado pela atenção

 
Daniel Ilha:

Meus testes estão sendo no servidor do Forex.

Estou iniciando a programar no MQL5, queria entender como setar uma timeframe via algorítimo.

Obrigado pela atenção

Nunca testei mas acho que daria para fazer algo assim


if (Period() != PERIOD_M12)

  {

    _Period = PERIOD_M12;

  }

 
Daniel Ilha:
Como definir um timeframe específico ao iniciar o EA?

Olá Daniel Ilha,

Por favor dê uma olhada na função ChartSetSymbolPeriod:

https://www.mql5.com/en/docs/chart_operations/chartsetsymbolperiod

Abraços,
Malacarne

Documentation on MQL5: Chart Operations / ChartSetSymbolPeriod
Documentation on MQL5: Chart Operations / ChartSetSymbolPeriod
  • www.mql5.com
Changes the symbol and period of the specified chart. The function is asynchronous, i.e. it sends the command and does not wait for its execution completion. The command is added to chart messages queue and will be executed after processing of all previous commands. The call of ChartSetSymbolPerid with the same symbol...
Razão: