Download MetaTrader 5
To add comments, please log in or register
How to test a program before buying?
shararath2004
26
shararath2004 2014.03.14 23:04 
i am a newbie to mql4, so please need some help now, as i said above, How to create a indicator buffer which will draw a chart of the gap between previous candles close and current candles open price?
Keith Watford
Moderator
7869
Keith Watford 2014.03.15 00:14  
int index;

Buffer[index] = Open[index] - Close[index+1] ;
Obviously, you would have to create a loop using index
James Hodges
2770
James Hodges 2014.03.15 01:11  
Hmm I'm not exactly sure what you mean by this... there should be no gap. The current candle should open where the price was when the previous candle closed.. unless you are talking about the gap that can form over the weekend?
shararath2004
26
shararath2004 2014.03.15 10:56  
GumRai:
Obviously, you would have to create a loop using index

i dont know how to create a indicator or expert, i dont know what is loop,

There is no other easy way?
Close[1]-Open[0] why this does not work?

if you can and if its easy for you, can you please create a simple indicator for me?

shararath2004
26
shararath2004 2014.03.15 11:00  
Jimdandy:
Hmm I'm not exactly sure what you mean by this... there should be no gap. The current candle should open where the price was when the previous candle closed.. unless you are talking about the gap that can form over the weekend?

In one minute chart most of the candles open with a smaller gap between its previous candles close, very smaller gaps
Keith Watford
Moderator
7869
Keith Watford 2014.03.15 12:31  
shararath2004:
i am a newbie to mql4, so please need some help now, as i said above, How to create a indicator buffer which will draw a chart of the gap between previous candles close and current candles open price?

GumRai:
Obviously, you would have to create a loop using index
int index;

Buffer[index] = Open[index] - Close[index+1] ;

shararath2004:


There is no other easy way?
Close[1]-Open[0] why this does not work?

Because you asked about an indicator buffer and the buffer would only contain values for realtime, if you use [1] and [0], not relative to each bar on the chart.

Also Close[1]-Open[0] means that if the open of the new bar is higher than the close of the previous bar, the result will be negative - is that what you want?

Tjipke de Vries
6275
Tjipke de Vries 2014.03.15 12:31  
shararath2004:

i dont know how to create a indicator or expert, i dont know what is loop,

There is no other easy way?
Close[1]-Open[0] why this does not work?

if you can and if its easy for you, can you please create a simple indicator for me?


Better way for you, if you wanna get this indicator

Is start learning or use a section like https://www.mql5.com/en/job

whroeder1
13593
whroeder1 2014.03.15 16:58  
Jimdandy:
Hmm I'm not exactly sure what you mean by this... there should be no gap. The current candle should open where the price was when the previous candle closed.. unless you are talking about the gap that can form over the weekend?
The close was the last tick in the previous period. The open is the next tick after the previous period. They will almost NEVER be equal. Equal means no tick.
shararath2004
26
shararath2004 2014.03.15 17:31  
GumRai:


Because you asked about an indicator buffer and the buffer would only contain values for realtime, if you use [1] and [0], not relative to each bar on the chart.

Also Close[1]-Open[0] means that if the open of the new bar is higher than the close of the previous bar, the result will be negative - is that what you want?


yeah, i understood now why Close[1]-Open[0] does not work, thank you so much for explaining this, and yes i just need a indicator which will show the gap either in negative or in positive,

and can you tell me how i can modify custom MACD indicator which is inbuilt in MT4 to make this indicator?

can you please help me to create this indicator?

/
To add comments, please log in or register