Coding help - page 90

 

Hi Mladen,

I have an indicator that plot price oscillator 15-71 SMA with signal line SMA 15.

PROBLEM: when I put this indicator,it appears only a little portion of the signal line......then,after pass time,appear longer.

If I close mt4 and reopen,the signal line is still little portion.

I select also level zero...namely when crossing 15-71...but as you can see in the image....level zero is wrong.

On my chart,SMA 15 is orange and SMA 71 is white.

Please ,see image.

thank's in advance

Files:
immagine.gif  23 kb
ppo.ex4  3 kb
ppo.mq4  3 kb
 
carbonmimetic:
Hi Mladen,

I have an indicator that plot price oscillator 15-71 SMA with signal line SMA 15.

PROBLEM: when I put this indicator,it appears only a little portion of the signal line......then,after pass time,appear longer.

If I close mt4 and reopen,the signal line is still little portion.

I select also level zero...namely when crossing 15-71...but as you can see in the image....level zero is wrong.

On my chart,SMA 15 is orange and SMA 71 is white.

Please ,see image.

thank's in advance

carbonmimetic

Here you go

Files:
ppo.gif  35 kb
ppo_1.mq4  3 kb
 

How many time I thank you since I discoverd this forum?

May be my indicators are very simple to code......but for me I know nothing on meta language...are impossible.....so....A BIG BIG BIG THANK YOU.

So the last but not least and more important to me is Demark's Sequential......I have 3 indicators but all are incompleted.

What about code it on my explanation?

I hope you will do it....

 
carbonmimetic:
How many time I thank you since I discoverd this forum?

May be my indicators are very simple to code......but for me I know nothing on meta language...are impossible.....so....A BIG BIG BIG THANK YOU.

So the last but not least and more important to me is Demark's Sequential......I have 3 indicators but all are incompleted.

What about code it on my explanation?

I hope you will do it....

Did you check the already existing versions for metatrader 4 (this one for example : https://www.mql5.com/en/forum/181798 ) but there is a lot more (you can use the search tool from the top of the page - it is a google search and is quite powerful - try searching TD sequential for example)

 

Hi all,

probably stupid question: I have an indicator with option price: 0-5; so 0 stands for Close; 1 for open? Can somebody help? thanks

 
Jonas_Hellwig:
Hi all, probably stupid question: I have an indicator with option price: 0-5; so 0 stands for Close; 1 for open? Can somebody help? thanks

Jonas

The prices are enumerated as follows :
0 - Close

1 - Open

2 - High

3 - Low

4 - Median (high+low)/2

5 - Typical (high+low+close)/3

6 - Weighted (high+low+close+close)/4

 
mladen:
Sorry, I have no idea what TimeFrameExpand() and TimeFrameRestore() do

Hi mladen

Source as follows!

Could you into MT4, thank you very much

_SECTION_BEGIN("pfoot");

TimeFrameSet(inDaily);

TR=Max(Max((High-Low),abs(Ref(Close,-1)-High)),abs(Ref(Close,-1)-Low));

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=HHV(H,N);

L2=LLV(L,N);

PPF=Ref(A,BarsLast(H2));//

PPF1=Ref(A1,BarsLast(H2));//

PPF2=Ref(A2,BarsLast(H2));

PPF3=Ref(A3,BarsLast(H2));//

//

PPFF=Ref(B,BarsLast(L2));//

PPFF1=Ref(B1,BarsLast(L2));//

PPFF2=Ref(B2,BarsLast(L2));//

PPFF3=Ref(B3,BarsLast(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,styleThick);

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

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

_SECTION_END();

Thank you

Kreangast

2013-5-24

 
mladen:
Did you check the already existing versions for metatrader 4 (this one for example : https://www.mql5.com/en/forum/181798 ) but there is a lot more (you can use the search tool from the top of the page - it is a google search and is quite powerful - try searching TD sequential for example)

All Demark's sequential are incompleted.....if you want (or someone else interesting with....) you can start coding it in the above link......as you can see I ask for it some month ago.....

I can write ALL explanations in order to code it and the powerfull use in multitimeframe...please ..tell me if you are ready!

I hope YES!!!!

best regards to my Coder!

p.s. may be you did not see that the above link was written by me?(https://www.mql5.com/en/forum/181798)

 

Hi,

I have this indicator I use (it is attached) which I use to draw a box for my trading time I can be at my terminal, so I can make it draw a blue background box, or grey etc which I must select. Originally it was a breakout indicator but I use it to plot my trade time.

Currently the extern color BoxHLColor = MidnightBlue; which I choose on a black background.

Would it be possible for the indicator to select this colour automatically, based on previous day candle colour

(or look back 2 day, 3 day etc) candle colour.

So if prev daily candle is green, then make the box green, if prev day finished red then make the BoxHLColor red etc.

I hope this makes sense. This would be very helpful and I really appreciate any help to do this.

PG

Files:
 

mladen..can you correct the error?

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

//| 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);

}

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

Reason: