Thanks I will try that. The advice was very useful.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi I'm trying to create a custom indicator, and I'm having trouble with what I need to do next in my code.
There is obviously a lot which I need to add and perhaps some that I need to leave out. However, I'm finding it difficult what I need to do next, at the moment my indicator compiles with no errors, but nothing happens when attached to a chart.
So what I want my indicator to do is:
- check the last three candles o the chart so 0,1 and 2.
- if the close of candle 1 is greater than the open of candle 1 AND the close of candle 2 is less than candle 2 open, THEN draw a horizontal line at the close of candle 2. I call this Support. Red Line
- if the close of candle 1 is less than the open of candle 1 AND the close of candle 2 is greater than candle 2 open, THEN draw a horizontal line at the close of candle 2. I call this Resistance. Blue Line
I understand an indicator can have 8 buffers in MT4, so I would like a max of 4 of each on a chart at any one time. So if there are already 4 support lines on the chart and the indicator detects another support line to be drawn it will delete the oldest line then create the new one. Please look at the picture to see what I want.I have attached the what I have so far of the indicator (which I know is not much) to this post for anyone that would be so kind enough to help me by telling what I need to do in order to get it working as I want.
I appreciate your time.