Need code help

Back to topics list To post a new topic, please log in or register
avatar
7
waimaj 2015.01.18 15: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.

Attached files:
  custommacd2tm.mq4  (6.05 KB)
avatar
2017
gooly 2015.01.18 19:19 #
 
If you don't see anything have you checked the whether the lines are above (below) the chat's highest prices?
avatar
7
waimaj 2015.01.18 21: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

avatar
Moderator
3419
GumRai 2015.01.18 22: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
avatar
7
waimaj 2015.01.18 22: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.

avatar
Moderator
3419
GumRai 2015.01.19 03: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 

avatar
7
waimaj 2015.01.19 12: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.

avatar
Moderator
3419
GumRai 2015.01.19 13: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. 

 

Back to topics list  

To add comments, please log in or register