Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
codersguru,
thanks so much for all your work and sharing of your knowledge. I've read all the lessons you have created so far and they are very informative. Keep up the great work!
WRR
In the function start() which is executed everytime new tick is delieved (right?),
function counted_bars = IndicatorCounted() is executed, which means counted_bars is always Bars -1, after line counted_bars--, counted_bars will be equal to Bars - 2, so pos should be equal to 2. But it seems not. What is the problem?
I tested the values of counted_bars and Bars. The first time the function start() runs,Bars already a big number, but counted_bars is 0, so pos is a large number. After that, I found when new bar first appears,
the Bars increases by 1, the counted_bars keeps the same, so the pos is 3,
when the new tick is delievered, the pos will be 2 (Bars keeps the same, counted_bars increases by 1 but keeps the same later).
Now my question is:
Every time the new bar first appears, pos = 3, so the
ExtMapBuffer1[3], ExtMapBuffer1[2], ExtMapBuffer1[1], ExtMapBuffer1[0] will be updated, other ExtMapBuffer1 elements will keep the same.
What's the point for that???? Anybody bother to give me a hint? I hate to see the magic buried in the MQL4.
My guess is when Bars changes (it always increase by 1), the indicator value
for the new bar to be shown in the windows will be always ExtMapBuffer1[0], others will be rotated from low to high one-by-one???
I have to agree with you Blooms.
My take on this indicator is that on the first run through, when counted_bars==0, what it needs to do is assign ExtMapBuffer1[] with a value for each Bar so they can be displayed in the window. After the first run through, when counted_bars>0, only ExtMapBuffer1[0] needs to be updated for each tick. I rewrote the code and got the exact same indicator window display as codersguru's original indicator.
REPLACE:
int start()
{
int counted_bars=IndicatorCounted();
int pos=Bars-counted_bars;
//---- check for possible errors
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
if (counted_bars>0) counted_bars--;
double dHigh , dLow , dResult;
Comment("Hi! I'm here on the main chart windows!");