Forum

Understanding chart High/Low vs Bid/Ask

I initially test my code by creating an indicator to display over charts (primarily daily charts) showing entry and exit points and colored lines to indicate profits vs losses. I use the Open / High / Low / Close to make estimates of where my trades will enter and exit. Now I'm testing my code in

Test for end of bar

Is there a way to signal when a bar ends and before the next bar begins? I'd like to set pending orders before a bar starts (typically a day bar). Is there a way to do that? I know how to get the beginning of a bar but getting the end of a bar alludes me

Confusing date functions auto updating local variables

I'm an experienced programmer of over 35 years, so the following is very odd to me. I'm trying to develop a function to be used in an expert adviser that would indicate when a new period is encountered. For example, if the period of my chart is days (PERIOD_D1), I want the first tick when the time

Can I turn line color on/off?

I have a buffer that draws line sections from one bar to another, much like the ZigZag indicator. But what I really want to do is draw a line section, then turn it off for some distance, and then draw another section. I know that a line can be only one color per buffer, but it would be nice to turn

Why is my indexing wrong?

I'm just recently getting into coding MQL4 and I'm really confused with the results I'm seeing. This is perplexing since I'm a professional programmer with over 30 years experience, including nearly 10 years in C++. I'll illustrate my problem with two pieces of code. The first is the one that I