Ajuda na codificação - página 489

 

Não importa, vejo agora que tenho que remover a linha AlarmTotal = AlarmTotal+1;

 

Preciso de ajuda para adicionar texto ao meu indicador

Eu escrevi um indicador personalizado que encontra os altos e baixos do balanço.

Atualmente ele coloca um ponto do objeto seta para o nível de preço e a barra de tempo. Verde para alto e vermelho para baixo.

Gostaria de mudá-lo para um texto que mostre uma variável de contagem.

Aqui está uma parte do código que criei, mas que não está mostrando o texto.

Alguém pode me mostrar o que está errado. Do que.

if (Low < Low

&& Low < Low

&& Low < Low

&& Low < Low

&& Low < Low

&& Low < Low)

{

SwingLoBar = 1;

SwingLo = Low;

SwingCount = SwingCount + 1;

ObjectCreate("Text",OBJ_TEXT,0,0,0);

ObjectSet("Text",OBJPROP_TIME,i);

ObjectSet("Text",OBJPROP_PRICE,SwingLo-20*pips);

ObjectSetString(0,"Text",OBJPROP_TEXT,SwingCount);

ObjectSet("Text",OBJPROP_COLOR,clrRed);
 
ThemBonez:
Escrevi um indicador personalizado que encontra os altos e baixos do SwingLo-20*_Point.

Atualmente, ele coloca um ponto do objeto seta para o nível de preço e a barra de tempo. Verde para Alto e Vermelho para Baixo.

Gostaria de mudá-lo para um texto que mostre uma variável de contagem.

Aqui está uma parte do código que criei, mas que não mostra o texto.

Alguém pode me mostrar o que está errado. Do que.

if (Low < Low

&& Low < Low

&& Low < Low

&& Low < Low

&& Low < Low

&& Low < Low)

{

SwingLoBar = 1;

SwingLo = Low;

SwingCount = SwingCount + 1;

ObjectCreate("Text",OBJ_TEXT,0,0,0);

ObjectSet("Text",OBJPROP_TIME,i);

ObjectSet("Text",OBJPROP_PRICE,SwingLo-20*pips);

ObjectSetString(0,"Text",OBJPROP_TEXT,SwingCount);

ObjectSet("Text",OBJPROP_COLOR,clrRed);

Tente mudar

ObjectSet("Texto",OBJPROP_TIME,i);

ObjectSet("Texto",OBJPROP_PRICE,SwingLo-20*pips);

para

ObjectSet("Texto",OBJPROP_TIME1,Tempo);

ObjectSet("Texto",OBJPROP_PRICE1,SwingLo-20*_Ponto);

 

Obrigado, mas não ajudou. Não há etiquetas de texto.

Aqui está o código inteiro, talvez isso ajude.

//+------------------------------------------------------------------+

//| SwingHighLow.mq4 |

//| Dream Reality Productions, LLC |

//| http://www.dreamrealityproductions.com |

//+------------------------------------------------------------------+

#property copyright "Dream Reality Productions, LLC"

#property link "http://www.dreamrealityproductions.com"

#property indicator_chart_window

#property indicator_buffers 6

#property indicator_color1 Orange

#property indicator_color2 Aqua

double SwingHiBar[];

double SwingLoBar[];

double SwingHiDraw[];

double SwingLoDraw[];

double SwingHi[];

double SwingLo[];

static int SwingCount=0;

double pips;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1);

SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1);

SetIndexArrow(1,233);

SetIndexArrow(0,234);

SetIndexBuffer(0,SwingHiDraw);

SetIndexBuffer(1,SwingLoDraw);

SetIndexBuffer(2,SwingHiBar);

SetIndexBuffer(3,SwingLoBar);

SetIndexBuffer(4,SwingHi);

SetIndexBuffer(5,SwingLo);

double ticksize = MarketInfo (Symbol(),MODE_TICKSIZE);

if (ticksize == .00001 || ticksize == .001)

pips = ticksize * 10;

else pips = ticksize;

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

//+------------------------------------------------------------------+

//| Find Hi and Lo Bars |

//+------------------------------------------------------------------+

int counted_bars = IndicatorCounted();

if (counted_bars<0) return (-1);

if (counted_bars>0) counted_bars--;

int uncountedbars = Bars - counted_bars;

//---

for (int i=4;i<uncountedbars;i++)

{

if (High > High

&& High > High

&& High > High

&& High > High

&& High > High

&& High > High)

{

SwingHiBar = 1;

SwingHi = High;

SwingCount = SwingCount + 1;

ObjectCreate("Text",OBJ_TEXT,0,0,0);

ObjectSet("Text",OBJPROP_TIME1,Time);

ObjectSet("Text",OBJPROP_PRICE1,SwingHi+20*pips);

ObjectSetString(0,"Text",OBJPROP_TEXT,SwingCount);

ObjectSet("Text",OBJPROP_COLOR,clrGreen);

}

else

{ SwingHiBar=0; SwingHi=0;

SwingHiDraw=0;

if (Low < Low

&& Low < Low

&& Low < Low

&& Low < Low

&& Low < Low

&& Low < Low)

{

SwingLoBar = 1;

SwingLo = Low;

SwingCount = SwingCount + 1;

ObjectCreate("Text",OBJ_TEXT,0,0,0);

ObjectSet("Text",OBJPROP_TIME1,Time);

ObjectSet("Text",OBJPROP_PRICE1,SwingLo-20*_Point);

ObjectSetString(0,"Text",OBJPROP_TEXT,SwingCount);

ObjectSet("Text",OBJPROP_COLOR,clrRed);

}

else {SwingLoBar = 0; SwingLo=0;

SwingLoDraw=0;}

}

}

return(0);

}

//+------------------------------------------------------------------+

 
ThemBonez:
Obrigado, mas não ajudou. Não há etiquetas de texto.

Aqui está o código inteiro, talvez isso ajude.

//+------------------------------------------------------------------+

//| SwingHighLow.mq4 |

//| Dream Reality Productions, LLC |

//| http://www.dreamrealityproductions.com |

//+------------------------------------------------------------------+

#property copyright "Dream Reality Productions, LLC"

#property link "http://www.dreamrealityproductions.com"

#property indicator_chart_window

#property indicator_buffers 6

#property indicator_color1 Orange

#property indicator_color2 Aqua

double SwingHiBar[];

double SwingLoBar[];

double SwingHiDraw[];

double SwingLoDraw[];

double SwingHi[];

double SwingLo[];

static int SwingCount=0;

double pips;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1);

SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1);

SetIndexArrow(1,233);

SetIndexArrow(0,234);

SetIndexBuffer(0,SwingHiDraw);

SetIndexBuffer(1,SwingLoDraw);

SetIndexBuffer(2,SwingHiBar);

SetIndexBuffer(3,SwingLoBar);

SetIndexBuffer(4,SwingHi);

SetIndexBuffer(5,SwingLo);

double ticksize = MarketInfo (Symbol(),MODE_TICKSIZE);

if (ticksize == .00001 || ticksize == .001)

pips = ticksize * 10;

else pips = ticksize;

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

//+------------------------------------------------------------------+

//| Find Hi and Lo Bars |

//+------------------------------------------------------------------+

int counted_bars = IndicatorCounted();

if (counted_bars<0) return (-1);

if (counted_bars>0) counted_bars--;

int uncountedbars = Bars - counted_bars;

//---

for (int i=4;i<uncountedbars;i++)

{

if (High > High

&& High > High

&& High > High

&& High > High

&& High > High

&& High > High)

{

SwingHiBar = 1;

SwingHi = High;

SwingCount = SwingCount + 1;

ObjectCreate("Text",OBJ_TEXT,0,0,0);

ObjectSet("Text",OBJPROP_TIME1,Time);

ObjectSet("Text",OBJPROP_PRICE1,SwingHi+20*pips);

ObjectSetString(0,"Text",OBJPROP_TEXT,SwingCount);

ObjectSet("Text",OBJPROP_COLOR,clrGreen);

}

else

{ SwingHiBar=0; SwingHi=0;

SwingHiDraw=0;

if (Low < Low

&& Low < Low

&& Low < Low

&& Low < Low

&& Low < Low

&& Low < Low)

{

SwingLoBar = 1;

SwingLo = Low;

SwingCount = SwingCount + 1;

ObjectCreate("Text",OBJ_TEXT,0,0,0);

ObjectSet("Text",OBJPROP_TIME1,Time);

ObjectSet("Text",OBJPROP_PRICE1,SwingLo-20*_Point);

ObjectSetString(0,"Text",OBJPROP_TEXT,SwingCount);

ObjectSet("Text",OBJPROP_COLOR,clrRed);

}

else {SwingLoBar = 0; SwingLo=0;

SwingLoDraw=0;}

}

}

return(0);

}

//+------------------------------------------------------------------+

Ele estava lá, mas apenas um (no passado)

Utilize este :

//+------------------------------------------------------------------+

//| SwingHighLow.mq4 |

//| Dream Reality Productions, LLC |

//| http://www.dreamrealityproductions.com |

//+------------------------------------------------------------------+

#property copyright "Dream Reality Productions, LLC"

#property link "http://www.dreamrealityproductions.com"

#property indicator_chart_window

#property indicator_buffers 6

#property indicator_color1 Orange

#property indicator_color2 Aqua

double SwingHiBar[];

double SwingLoBar[];

double SwingHiDraw[];

double SwingLoDraw[];

double SwingHi[];

double SwingLo[];

static int SwingCount=0;

double pips;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,1);

SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,1);

SetIndexArrow(1,233);

SetIndexArrow(0,234);

SetIndexBuffer(0,SwingHiDraw);

SetIndexBuffer(1,SwingLoDraw);

SetIndexBuffer(2,SwingHiBar);

SetIndexBuffer(3,SwingLoBar);

SetIndexBuffer(4,SwingHi);

SetIndexBuffer(5,SwingLo);

double ticksize = MarketInfo (Symbol(),MODE_TICKSIZE);

if (ticksize == .00001 || ticksize == .001)

pips = ticksize * 10;

else pips = ticksize;

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

//+------------------------------------------------------------------+

//| Find Hi and Lo Bars |

//+------------------------------------------------------------------+

int counted_bars = IndicatorCounted();

if (counted_bars<0) return (-1);

if (counted_bars>0) counted_bars--;

int uncountedbars = Bars - counted_bars;

//---

for (int i=4;i<uncountedbars;i++)

{

if (High > High

&& High > High

&& High > High

&& High > High

&& High > High

&& High > High)

{

SwingHiBar = 1;

SwingHi = High;

SwingCount = SwingCount + 1;

ObjectCreate("Text"+Time,OBJ_TEXT,0,0,0);

ObjectSet("Text"+Time,OBJPROP_TIME1,Time);

ObjectSet("Text"+Time,OBJPROP_PRICE1,SwingHi+20*_Point);

ObjectSetString(0,"Text"+Time,OBJPROP_TEXT,SwingCount);

ObjectSet("Text"+Time,OBJPROP_COLOR,clrGreen);

}

else

{ SwingHiBar=0; SwingHi=0;

SwingHiDraw=0;

if (Low < Low

&& Low < Low

&& Low < Low

&& Low < Low

&& Low < Low

&& Low < Low)

{

SwingLoBar = 1;

SwingLo = Low;

SwingCount = SwingCount + 1;

ObjectCreate("Text"+Time,OBJ_TEXT,0,0,0);

ObjectSet("Text"+Time,OBJPROP_TIME1,Time);

ObjectSet("Text"+Time,OBJPROP_PRICE1,SwingLo-20*_Point);

ObjectSetString(0,"Text"+Time,OBJPROP_TEXT,SwingCount);

ObjectSet("Text"+Time,OBJPROP_COLOR,clrRed);

}

else {SwingLoBar = 0; SwingLo=0;

SwingLoDraw=0;}

}

}

return(0);

}

//+------------------------------------------------------------------+
 

caro mladen, mrtools aguardando ansiosamente sua resposta para minhas dúvidas sobre a mudança de configurações de indicador no correio acima.

espero que você me responda quando o tempo permitir.

obrigado.

 
brijeshsinh:
Olá,

can mladen, mrtools me ajudam a adicionar as seguintes configurações para o indicador--- Rsi bar chart v2.02 mtf & alertas

--podem ser coloridas de forma diferente quando cruzam acima ou abaixo da linha média (50 nível para perspectiva rsi); --i.e acima de 50 linha uma cor e abaixo de 50 nível uma cor diferente.

---podem ser adicionadas médias móveis no indicador em janela separada, pois podemos adicionar médias móveis para o gráfico principal(como é visto na imagem abaixo).

anexando aqui o indicador e a imagem.

rsi_bar_chart_v2.02_mtf_amp_alerts.mq4

Agradecemos antecipadamente, sua ajuda será muito apreciada.

Esse indicador tem 4 valores (ele é combinado a partir de 4 valores rsi diferentes). Isso exclui a travessia - já que não há nenhum valor que possa ser usado como critério para a travessia de algum valor.

Em média - a mesma coisa que para as cruzes : já que existem 4 valores rsi média não tem um valor único a ser aplicado a

 

obrigado mladen pela resposta e por encontrar tempo para mim. agradeço a ajuda de vocês.

 

Olá,

mladen, mr tools can you please help change following settings in indicator FXUltraTrend posted below to

--- mostrar em janela separada como linha, (ou histograma) com setas para mostrar a mudança de cor se possível (por padrão na configuração atual pinta barras no gráfico principal)

---- e, se possível, adicionar coluna para diferentes configurações, para que possa ser alterada de acordo com nosso desejo. ( no modo padrão atual, não tem nenhuma coluna para adicionar configurações)

anexando abaixo o indicador e sua imagem para você

fxultratrend.mq4

Espero que vocês não se importem comigo por ter tirado algum tempo de vocês, mas vocês estão fazendo um ótimo trabalho para alguém como nós que é novo nesta plataforma e não conhece programação.

Vocês realmente merecem o meu apreço e o de todos os membros deste fórum por seus valiosos esforços.

obrigado pela resposta rápida para o post anterior.

Arquivos anexados:
444.png  56 kb
 

Implementar; Indicador NonLag_Schaff_TrendCycle:

Olá Pró-Codificadores,

Será que alguém poderia me ajudar na implementação do indicador NonLag_Schaff_TrendCycle?

Indicador Externs:

Externo int FastLength = 23;

Externo int SlowLength = 50;

Externo int StcPeriod = 10;

Externo int MacdPrice = PRICE_CLOSE;

Externo bool Interpolar = verdadeiro;

bool MultiColor = verdadeiro;

Buffers indicadores:

IndicatorBuffers(8);

SetIndexBuffer(0,stcBuffer);

SetIndexBuffer(1,stcBufferUA);

SetIndexBuffer(2,stcBufferUB); SetIndexBuffer(2,stcBufferUB);

SetIndexBuffer(3,macdBuffer);

SetIndexBuffer(4,fastKBuffer);

SetIndexBuffer(5,fastDBuffer);

SetIndexBuffer(6,fastKKBuffer); SetIndexBuffer(6,fastKKBuffer);

SetIndexBuffer(7,fastKKBuffer); SetIndexBuffer(7,trend);

Eu tento fazer algo como:

double STC1_c=iCustom(Symbol(),0, "NonLag_Schaff_TrendCycle",FastLength,SlowLength,StcPeriod,MacdPrice,Interpolate,0,bar);

duplo STC2_c=iCustom(Symbol(),0, "NonLag_Schaff_TrendCycle",FastLength,SlowLength,StcPeriod,MacdPrice,Interpolate,0,bar+1);

if((STC1_c>15 && STC2_c85 && STC2_c COMPRAR

if((STC1_c15)||(STC1_c85) -> SELL

Mas recebo uma mensagem de erro:

Erro: NonLag_Schaff_TrendCycle foi removido.

Acho que posso ter lido mal os amortecedores. Alguém tem alguma sugestão?

Agradecemos antecipadamente!

Razão: