Ajuda na codificação - página 91

 
k3rn3l:
mladen... você pode corrigir o erro?

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

//| MTF_RSI.mq4 |

//| Copyright © 2006, Keris2112 |

//| |

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

#property copyright "Copyright © 2006, Keris2112"

#property link "https://www.forex-tsd.com"

//----

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 Red

#property indicator_color2 DodgerBlue

#property indicator_color3 White

#property indicator_level1 30

#property indicator_level2 70

#property indicator_minimum 0

#property indicator_maximum 100

//----

extern int TimeFrame=5;

extern int RSIperiod=33;

extern int applied_price=0;

extern int TimeFrame1=15;

extern int RSIperiod1=21;

extern int applied_price1=0;

extern int TimeFrame2=15;

extern int RSIperiod2=14;

extern int applied_price2=0;

//----

double ExtMapBuffer1[];

double ExtMapBuffer2[];

double ExtMapBuffer3[];

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

//| Custom indicator initialization function |

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

int init()

{

//---- indicator line

SetIndexBuffer(0,ExtMapBuffer1);

SetIndexStyle(0,DRAW_LINE);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexStyle(1,DRAW_LINE);

SetIndexBuffer(2,ExtMapBuffer3);

SetIndexStyle(2,DRAW_LINE);

//---- name for DataWindow and indicator subwindow label

switch(TimeFrame)

{

case 1 : string TimeFrameStr="Period_M1"; break;

case 5 : TimeFrameStr="Period_M5"; break;

case 15 : TimeFrameStr="Period_M15"; break;

case 30 : TimeFrameStr="Period_M30"; break;

case 60 : TimeFrameStr="Period_H1"; break;

case 240 : TimeFrameStr="Period_H4"; break;

case 1440 : TimeFrameStr="Period_D1"; break;

case 10080 : TimeFrameStr="Period_W1"; break;

case 43200 : TimeFrameStr="Period_MN1"; break;

default : TimeFrameStr="Current Timeframe";

}

IndicatorShortName("MTF_RSI("+RSIperiod+") ("+TimeFrameStr+")");

}

//----

return(0);

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

//| MTF RSI |

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

int start()

{

datetime TimeArray[];

int i,limit,y=0,counted_bars=IndicatorCounted();

// Plot defined time frame on to current time frame

ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);

limit=Bars-counted_bars;

for(i=0,y=0;i<limit;i++)

{

if (Time<TimeArray[y]) y++;

//----

ExtMapBuffer1=iRSI(NULL,TimeFrame,RSIperiod,applied_price,y);

}

datetime TimeArray1[];

int ii,limiti,yi=0,counted_bars1=IndicatorCounted();

// Plot defined time frame on to current time frame

ArrayCopySeries(TimeArray1,MODE_TIME,Symbol(),TimeFrame1);

limiti=Bars-counted_bars1;

for(ii=0,yi=0;ii<limiti;ii++)

{

if (Time<TimeArray1[yi]) yi++;

//----

ExtMapBuffer2=iRSI(NULL,TimeFrame1,RSIperiod1,applied_price1,yi);

}

datetime TimeArray2[];

int iii,limitii,yii=0,counted_bars2=IndicatorCounted();

// Plot defined time frame on to current time frame

ArrayCopySeries(TimeArray2,MODE_TIME,Symbol(),TimeFrame2);

limitii=Bars-counted_bars2;

for(iii=0,yii=0;iii<limitii;iii++)

{

if (Time<TimeArray2[yii]) yii++;

//----

ExtMapBuffer3=iRSI(NULL,TimeFrame2,RSIperiod2,applied_price2,yii);

}

//----

return(0);

}

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

Experimente o anexo

Arquivos anexados:
 

Olá, Mladen,

por favor, você pode adicionar "velo6" ao indicador anexo?

Preciso de entrada para cor e "true-false".... ver imagem, por exemplo.

SEMPRE OBRIGADO......

Arquivos anexados:
euro.gif  32 kb
 

1) durante a tendência, as fitas de bollinger tornam-se mais largas..... e a tendência pára e há um intervalo de variação de treding.durante o contrato de fitas de bollinger do intervalo de comercialização e nesta situação é muito bom usar o stoc oversold-overbought.

esta é minha fórmula metastoch...

LARGURA:=

((Mov(C,71,S)+(2*(Std(C,71))))-))

(Mov(C,71,S)-(2*(Std(C,71)))));

MEDIA:=Mov(WIDTH,15,S);

ST:=Stoch(5,3);

TIME:=BarsSince(WIDTH=0 AND

BarsSince(WIDTH<MEDIA)<=5;

CONDBUY:=ST<=30 OR (Ref(ST<=30,-1) AND H<=Ref(H,-1));

TEMPO E CONDOMÍNIO

EXPLICAÇÃO:

1) Eu uso a faixa de bollinger 71 e desvio 2

2) sobre a largura da fita de bollinger, eu aplico uma média móvel simples de 15

3) quando a largura da banda de bollinger está abaixo do SMA e também para 5 barras depois disso, isso significa que o mercado está começando a comercializar na faixa....

4) quando há faixa de comércio que eu vejo para estocástico abaixo de 30

Arquivos anexados:
 
carbonmimetic:
Olá, Mladen,

por favor, você pode adicionar "velo6" ao indicador anexo?

Preciso de entrada para cor e "true-false".... ver imagem, por exemplo.

SEMPRE OBRIGADO......

carbonmimético

Aqui você vai

Arquivos anexados:
 

...como eu disse antes... SEMPRE OBRIGADO!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

Olá Mladen

Para incomodar você, por favor, coloque o código nos indicadores MT4 okay?

Estou ansioso para testar.

Obrigada a você

Kreangast

2013/5/25

 
Kreangast:
Olá Mladen

Para incomodar você, por favor, coloque o código nos indicadores MT4 okay?

Estou ansioso para testar.

Obrigada a você

Kreangast

2013/5/25

Desculpe

Como não uso o Amibroker, não posso converter esse código para metatrader 4 e ter 100% de certeza de que está correto (e eu odiaria ser responsável por algum indicador codificado incorretamente).

 
mladen:
DesculpeSpulpePor não usar o Amibroker não posso converter esse código para metatrader 4 e ter 100% de certeza de que está correto (e eu odiaria ser responsável por algum indicador codificado incorretamente)

Olá Mladen

Desculpe! AMI Desde que o problema foi resolvido.

Agradecemos a sua ajuda para substituir o MT4.

"-BarsSince(X)=BarsLate(X)"

_SECTION_BEGIN("pfoot");

TimeFrameSet(inDaily);

TR=Máx(Max((Alto-Baixo),abs(Ref(Fechado,-1)-Alto)),abs(Ref(Fechado,-1)-Baixo));

A= H-(TR*0,3);

A1=H-(TR*0,6);

A2=H-(TR*0,8);

A3=H-(TR*1.0);

//

B= L+(TR*0.3);

B1=L+(TR*0.6);

B2=L+(TR*0,8);

B3=L+(TR*1.0);

//

N=100;

H2=H===HHV(H,N);//

L2=L===LLV(L,N);//

PPF=Ref(A,-BarsDesde(H2));//-BarsDesde=BarsLate

PPF1=Ref(A1,-BarsSine(H2));//

PPF2=Ref(A2,-BarsSine(H2));//

PPF3=Ref(A3,-BarsSine(H2));//

//

PPFF=Ref(B,-BarsSince(L2));//

PPFF1=Ref(B1,-BarSince(L2));//

PPFF2=Ref(B2,-BarsDesde(L2));//

PPFF3=Ref(B3,-BarsDesde(L2));//

TimeFrameRestore();

// Plot the Support Levels Clouds and Lines //

Plot(TimeFrameExpand(PPF,inDaily,expandLast), "R1", colorGreen, styleThick);

Plot(TimeFrameExpand(PPF1,inDaily,expandLast), "R2", colorGreen,styleThick);

Plot(TimeFrameExpand(PPF2,inDaily,expandLast), "R3", colorGreen,styleThick);

Plot(TimeFrameExpand(PPF3,inDaily,expandLast), "R4", colorGreen,styleThick);

Plot(TimeFrameExpand(PPFF,inDaily,expandLast), "S1", colorBlue,styleThick);

Plot(TimeFrameExpand(PPFF1,inDaily,expandLast), "S2", colorBlue,colorBlue,styleThick);

Plot(TimeFrameExpand(PPFF2,inDaily,expandLast), "S3", colorBlue,styleThick);

Plot(TimeFrameExpand(PPFF3,inDaily,expandLast), "S4", colorBlue,styleThick);

_SECTION_END();

Obrigado

Kreangast

 

Formulo aqui minha pergunta.

Qual é o método para reduzir o número de barras que mostram um indicador no gráfico?

Sem ter que reduzir o número de barras mostradas no gráfico Metatrader.

Há algumas linhas de código que podem ser aplicadas a um grande número de indicadores?

Obrigado por sua atenção.

 
Antonsan:
Eu formulo aqui minha pergunta.

Qual é o método para reduzir o número de barras que mostram um indicador no gráfico?

Sem ter que reduzir o número de barras mostradas no gráfico Metatrader.

Há algumas linhas de código que podem ser aplicadas a um grande número de indicadores?

Obrigado por sua atenção.

Antonsan

Favor ler este post : https://www.mql5.com/en/forum/180284/page31. Repetirá a essência - você deve mudar o limite de barras no código. Não há outra maneira.

Razão: