Coding help - page 148

 
studbiol:
Sorry Mladen, I didn't realize the different Parameters. Thank you for the indicator.

Glad that it is clarified

Happy trading

 
fareastol:
Hi MrTools and Mladen,

Please help me an indicator to know the distance between current close and the opening price of the year. I always need to quickly scan these distance positions among different pairs to identify current market trend and sentiment. I think such an indicator would also benefit many other purposes and traders in our daily work. I got some work of Mladen on this, as far as i know, but they didn't compare current price to Opening Yearly.

Sorry for my bad english description. Thanks very much for your help.

fareastol

fareastol

This can find you the open price of the year fairly quickly :

for (int i=0; i<12; i++) if (TimeYear(iTime(NULL,PERIOD_MN1,i))!=TimeYear(iTime(NULL,PERIOD_MN1,i+1))) break;

double yearOpen = iOpen(NULL,PERIOD_MN1,i);

Then you simply calculate the difference of the current close (Close[0] does not matter what time frame are you using when you call it) and that yearOpen price and that would be it. If you need it as an indicator, attached one that display a horizontal line at the current year open price and writes out the distance in pips as a comment

Files:
year_open.mq4  1 kb
 

I don't know how to express my gratitude Mladen.

Very big thanks for your support !

fareastol

 

Dear Mladen / Mrtools

Is it possible to convert MACD_chart (upper-attached) exactly as MACD nrp_csc (lower-attached) ?

Like Color change on MACD (with candle bars) when it cross Signal line (EMA) !

Thanks for any help

secretcode

Files:
 
secretcode:
Dear Mladen / Mrtools

Is it possible to convert MACD_chart (upper-attached) exactly as MACD nrp_csc (lower-attached) ?

Like Color change on MACD (with candle bars) when it cross Signal line (EMA) !

Thanks for any help

secretcode

secretcode

Those are both MACD indicators. The only difference is that the MACD_chart is using the built in MACD and a built in MACD as we know it has a SMA for signal line and not the EMA (as it should be). Is that the change that you are looking for in the MACD_chart indicator?

 
mladen:
secretcode Those are both MACD indicators. The only difference is that the MACD_chart is using the built in MACD and a built in MACD as we know it has a SMA for signal line and not the EMA (as it should be). Is that the change that you are looking for in the MACD_chart indicator?

Thanks Mladen for reply and consideration

Yes, i am looking for Signal line (ema) in MACD chart version with color change on MACD line when it cross Signal line, if possible

 
secretcode:
Thanks Mladen for reply and consideration Yes, i am looking for Signal line (ema) in MACD chart version with color change on MACD line when it cross Signal line, if possible

secretcode

Just a bit more explanation 9after a closer look at the code) : what you are seeing there (as far as lines are concerned) is the following - 2 ema lines (which are the basis for MACD calculation) and something that looks like signal line but it is not that. See the picture and see when the signal line crosses macd on a regular MACD, and see when the "signal line" (the white line) crosses any of the ema lines on chart - they do not correspond at all - simply because that is not a signal line at all

It, as it is coded, even the colors of the bars are determined on the slope of the last 3 bars of that "signal line" and not at their crosses

Perhaps it is best to use that "macd" in the form it is (just a thought)

Files:
macd_chart.gif  36 kb
 
mladen:
secretcode

Just a bit more explanation 9after a closer look at the code) : what you are seeing there (as far as lines are concerned) is the following - 2 ema lines (which are the basis for MACD calculation) and something that looks like signal line but it is not that. See the picture and see when the signal line crosses macd on a regular MACD, and see when the "signal line" (the white line) crosses any of the ema lines on chart - they do not correspond at all - simply because that is not a signal line at all

It, as it is coded, even the colors of the bars are determined on the slope of the last 3 bars of that "signal line" and not at their crosses

Perhaps it is best to use that "macd" in the form it is (just a thought)

Mladen

You are right, It's not a exactly 'MACD on Chart' in terms of Macd calculations and that is the reason i requested to make it better!

Thanks a lot for your time and efforts and explanation

Best Regards

secretcode

 

Horizontal High Low lLine on MONDAY only

Hi friends,

Please help to code an indi that SHOWING

"Horizontal High Low lLine on MONDAY only"

.

Thank you and regards,

anton

Note: if possible the day (monday, tuesday, etc) can be changed.

Files:
monday.png  42 kb
 
anton1:
Hi friends,

Please help to code an indi that SHOWING

"Horizontal High Low lLine on MONDAY only"

.

Thank you and regards,

anton

Note: if possible the day (monday, tuesday, etc) can be changed.

anton1

Here you go. You can chose the day of the week and set the colors of the lines

Files:
Reason: