Coding help - page 185

 

Can someone know how to get bar chart so that bar shows only closing? Like added image.

 
loeil:
Can someone know how to get bar chart so that bar shows only closing? Like added image.

loeil,

take a look at this thread : https://www.mql5.com/en/forum/183501 . Maybe that helps

 
mladen:
loeil, take a look at this thread : https://www.mql5.com/en/forum/183501 . Maybe that helps

Thank you

 

Thank you

 

hi mladen,

i use your recent version #1840 on page 184 to testback/stepback to dpo version and compare the signals with original Detrended Price Oscillator.mq4 - MQL4 Code Base, it seems they produce different signals & numerical value signals, what's happening? i guess they ought to have same signals, do my "stepback" as attach has something not correct? thanks again for looking what's happening.

Files:
 
kenwa:
hi mladen, i use your recent version #1840 on page 184 to testback/stepback to dpo version and compare the signals with original Detrended Price Oscillator.mq4 - MQL4 Code Base, it seems they produce different signals & numerical value signals, what's happening? i guess they ought to have same signals, do my "stepback" as attach has something not correct? thanks again for looking what's happening.

kenwa

priceSwitch() function in the indicator from that link has an error in it.

It is always returning Low as the results of asking the price and not the one that should be (that error is avoided in the version I posted). The function goes like this now :

double priceSwitch(int i)

{

double price;

switch(PriceType)

{

case PRICE_CLOSE:

price = Close;

case PRICE_OPEN:

price = Open;

case PRICE_HIGH:

price = High;

case PRICE_LOW:

price = Low;

}

return(price);

}[/PHP]

and it should be like this :

[PHP]double priceSwitch(int i)

{

double price;

switch(PriceType)

{

case PRICE_CLOSE:

price = Close; break;

case PRICE_OPEN:

price = Open; break;

case PRICE_HIGH:

price = High; break;

case PRICE_LOW:

price = Low; break;

}

return(price);

}

When that function is corrected, then both are exactly the same (like on this example)

all the best

Files:
dpo.gif  36 kb
 

hi mladen,

so what i get your meanings, is it? (first) the version on above #1845 is correct raw dpo value as it should be? (rather the link indicator has error signals?) so if i use the version on above #1845, it is correct signal?

(second) also if i change the link indicator inside code to your PHP code , then it will has no error? and has same signals as the version on above #1845?

thanks again for some clarification.

 
kenwa:
hi mladen,

so what i get your meanings, is it? (first) the version on above #1845 is correct raw dpo value as it should be? (rather the link indicator has error signals?) so if i use the version on above #1845, it is correct signal?

(second) also if i change the link indicator inside code to your PHP code , then it will has no error? and has same signals as the version on above #1845?

thanks again for some clarification.

kenwa

Version at post 1845 is correct

Version at metaquotes site is wrong

Better to use the version I gave you since in that version you can use median, typical and weighted prices too and since it is faster and simpler

__________________

PS: the detrended price oscillator actually has different values. One version of a correct dpo was posted here : https://www.mql5.com/en/forum/174298

 

hi mladen,

how about this version Detrended Price Oscillator - MQL4 Code Base of dpo, is this version correct in coding & signal ? thanks again.

 
kenwa:
hi mladen, how about this version Detrended Price Oscillator - MQL4 Code Base of dpo, is this version correct in coding & signal ? thanks again.

Definition of the DPO : Detrended price oscillator - Wikipedia, the free encyclopedia

If it calculates like that than it is OK. If not, than it is not OK

Reason: