Quaisquer perguntas de recém-chegados sobre MQL4 e MQL5, ajuda e discussão sobre algoritmos e códigos - página 670
Você está perdendo oportunidades de negociação:
- Aplicativos de negociação gratuitos
- 8 000+ sinais para cópia
- Notícias econômicas para análise dos mercados financeiros
Registro
Login
Você concorda com a política do site e com os termos de uso
Se você não tem uma conta, por favor registre-se
Como criar uma série de instâncias de classe?
Eu fiz ClassName* className[], depois ArrayResize nele, mas isso não me dá acesso a métodos
Sua classe, cujas instâncias você deseja coletar em um array, deve ser herdada de CObject.
E depois é simples: crie uma lista (array) de objetos CArrayObj, e adicione seus objetos a ela.
Procurando as palavras "modelo indicador" e seu nome não encontra nada, e você já escreveu aqui sobre esse volume de Guerra e Paz.
Qualquer combinação de palavras do correio vem à mente.
Bem, desculpe, sobre o modelo indicador talvez eu o tenha confundido - o modelo de arrasto foi afixado.
Vamos colocar desta forma: criar um modelo de indicador no editor, adicionar o número necessário de variáveis de entrada e buffers a serem desenhados.
Em seguida, separe o que você precisa fazer da tarefa específica.
Se você diz que é ruim, diga-me como torná-lo bom. Mova os cálculos para o OnInit?
Fair rebuke )) Aqui, uma variante do código que foi publicado aqui:
Tente fazer isso dessa maneira. Você não precisa mover nada para o OnInit.
Fair rebuke )) Aqui, uma variante do código que foi publicado aqui:
Tente fazer desta maneira. Você não precisa mover nada para o OnInit.
Eu não publiquei tal código aqui - não é o meu estilo :)
Utilizo outras construções - é mais simples e claro.
No OnInit() ela deve ser transferida. Por que você precisa atribuir uma matriz ao buffer indicador em cada carrapato?
Eu não publiquei tal código aqui - não é o meu estilo :)
Utilizo outras construções - mais simples e claras.
É meu, como poderia ser mais simples? ))) (pelo menos, também tenho em meu modelo olimite de comentários= taxas_total - 1;//--- Primeira chamada de indicador ou mudança de prazo ou carregamento de dados do histórico) e meu estilo de formatação - um colchete próximo a() {
Para aprender a escrever seu próprio indicador, pegue o modelo acima e adicione pelo menos o preço de fechamento e obtenha seu primeiro indicador, depois aprenda a fazer o MAH a partir deste preço de fechamento
Eu não publiquei tal código aqui - não é o meu estilo :)
Utilizo construções diferentes - mais simples e mais claras.
Nada precisa ser copiado para o OnInit(). Por que eu deveria atribuir uma matriz ao buffer indicador a cada tick?
Não é o seu código. Foi publicado por alguns de meus colegas, mas não consigo lembrar quem e onde. Foi este código que eu quis dizer quando disse que nada deveria ser movido para o OnInit, mas não o código fonte. Eu não fui muito claro.
E que construção você recomendaria? Isto parece ser muito simples.
Ah, está ali o autor da peça )))) À minha frente. A propósito, também utilizo este estilo de formatação - com uma abertura de parênteses curvos em uma linha.Ah, aqui está o autor do trecho )))) À minha frente. A propósito, também utilizo este estilo de formatação - com uma abertura de parênteses enrolados em uma linha.
Você executa o Assistente para criar um indicador, seleciona tipos e cor de linhas e adiciona entradas, se necessário.
e isso é tudo, o indicador está pronto, então copieo corpo daOnCalculate() do modelo e escreva os cálculos ,
você pode escrever seu primeiro indicador em 1 minuto, o código "Olá palavra I indicador! - Eu mostrei :)
ZS: A propósito, os indicadores podem ser transferidos do MT4 para o MT5 nesta forma, o principal é configurar corretamente os buffers de indicadores, no MT5 há uma rasteira na indexação de arrays sob os buffers.... eles são apenas matrizes com a matriz usual )))) indexação .... costumava ser difícil habituar-se à indexação de buffers indicadores no MT4, agora ao contrário, é impossível habituar-se e mudar para o MT5 ))))Este não é o seu código. Foi publicado por um de meus colegas, mas não consigo lembrar quem e onde. Era este código que eu queria dizer quando disse que nada deveria ser movido para o OnInit, mas não o código fonte. Eu não fui muito claro.
E que construção você recomendaria? Este aqui parece ser muito simples.
Ah, está ali o autor da peça )))) À minha frente.sim, para que serve o código do modelo de indicador? execute o assistente para criar um indicador , escolha os tipos e cores das linhas e, se necessário, adicione entradas
e pronto, o indicador está pronto, então copie o corpo do template OnCalculate() e escreva os cálculos,
você pode escrever seu primeiro indicador em 1 minuto, o código acima é "Olá palavra I indicador!!!" Eu mostrei :)
PS: a propósito, neste formulário, os indicadores podem ser transferidos do MT4 para o MT5, o principal é configurar os buffers do indicador corretamente, no MT5 há um horror que com matrizes de indexação para buffers .... eles são apenas matrizes com a matriz usual)))) indexação .. .. antes era difícil se acostumar com a indexação de buffers de indicadores no MT4, agora, pelo contrário, é impossível se acostumar e mudar para MT5))))Nada complicado. Um exemplo de indicador de plataforma cruzada (usa uma classe), mas o modelo pode ser retirado - remova a classe e tudo supérfluo que dará erros depois disso - o modelo de plataforma cruzada permanecerá.
Este indicador funcionará da mesma forma em ambas as plataformas sem modificação - apenas compilação com a extensão necessária. Eu tive que dividir o código em duas partes - a classe e o próprio indicador (tudo estava em uma listagem)
Aula:
Indicador: