Download MetaTrader 5
To add comments, please log in or register
Find out the latest MQL5.community news!
waimaj
23
waimaj 2015.01.18 14:23 

hi everybody

i am almost coding illiterate so i try to learn by myself. i am trying to make an indicator based on macd cross that will draw horizontal line on the main window when macd line equals zero at different time frames at the same time. i try to modify macd (attached) but it shows nothing. could you fix the problem and explain it to me.

Files:
Carl Schreiber
5937
Carl Schreiber 2015.01.18 18:19  
If you don't see anything have you checked the whether the lines are above (below) the chat's highest prices?
waimaj
23
waimaj 2015.01.18 20:07  
gooly:
If you don't see anything have you checked the whether the lines are above (below) the chat's highest prices?

hi gooly


yes i checked the" objects" on the chart, nothing is there

Keith Watford
Moderator
7887
Keith Watford 2015.01.18 21:35  
waimaj:

hi everybody

i am almost coding illiterate so i try to learn by myself. i am trying to make an indicator based on macd cross that will draw horizontal line on the main window when macd line equals zero at different time frames at the same time. i try to modify macd (attached) but it shows nothing. could you fix the problem and explain it to me.

I haven't looked at your code, but i think it extremely unlikely that the macd line exactly equals zero at different time frames at the same time
waimaj
23
waimaj 2015.01.18 21:45  
GumRai:
I haven't looked at your code, but i think it extremely unlikely that the macd line exactly equals zero at different time frames at the same time

hi GumRai,

i think you misunderstood me or i have not explain my idea clearly. what i mean is to draw the horizontal lines of all the timeframes.

Keith Watford
Moderator
7887
Keith Watford 2015.01.19 02:12  

I had a quick look at your code and to be honest I have no idea what you are trying to do

I do see that you are only declaring 3 buffers, but trying to use 8. I am sure that you are getting array out of range errors 

waimaj
23
waimaj 2015.01.19 11:57  
GumRai:

I had a quick look at your code and to be honest I have no idea what you are trying to do

I do see that you are only declaring 3 buffers, but trying to use 8. I am sure that you are getting array out of range errors 

GumRai


what i am trying to do is to code an indicator that draws 4 horizontal lines on the main chart
one when macd equals zero on 5m timeframe and the second when macd equals zero on 15m timeframe the third when macd equals zero on 30m timeframe the fourth when macd equals zero on 1h timeframe the fifth when macd equals zero on 4h time frame.

Keith Watford
Moderator
7887
Keith Watford 2015.01.19 12:02  
GumRai:

I had a quick look at your code and to be honest I have no idea what you are trying to do

I do see that you are only declaring 3 buffers, but trying to use 8. I am sure that you are getting array out of range errors 

waimaj:

GumRai


what i am trying to do is to code an indicator that draws 4 horizontal lines on the main chart
one when macd equals zero on 5m timeframe and the second when macd equals zero on 15m timeframe the third when macd equals zero on 30m timeframe the fourth when macd equals zero on 1h timeframe the fifth when macd equals zero on 4h time frame.

 Have you checked the log for an "Array out of range error"?

It doesn't really matter what you are trying to do, but if you are trying to use buffers with zero size, your code will not work as expected. 

/
To add comments, please log in or register