This is where I had a hair pulling moment. My arrow indicator was correct, while my string variable wasn't always. After much cursing, I finally came to the conclusion that my loop analyzed the chart from front to back, and therefore it was giving me the first chronological indicator which was available to it. To fix this, I changed my loop to...
for (i=WindowBarsPerChart(); i>0; i--)
{
.......
... which now reads it correctly.
But here is my issue:
In the first for loop which went backwards, I would get signal generation while the bar was being created -- I could tell because even though the string was incorrect, arrows were still being generated on the chart. For example, if the 2nd bar was positive but then went negative, it would show me the positive indicator, and then take it away once it went negative. The second for loop works correctly; however, it does not show the signal while it is being generated... it will only show the signal after the bar is complete. How do I fix the second loop so that it will show the signal as it is being created?
Well that figures. I spent 8-10 hours trying to troubleshoot
this thing before I gave in and posted. Now, 15 minutes after my post I
find the answer. My loop should've been...
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
To get MT to post arrows for past indication of some event I would do something like this...
This all worked well, until I wanted to make it add a variable to the condition. For example, let's say I wanted to add...
... { ExtMapBuffer2[i] = High[i] + nShift*Point; strFirstIndication = "Possible Downtrend"; ObjectSetText("lblSomeLabelOnTheChart", strFirstIndication, 10, "Arial", Black); }This is where I had a hair pulling moment. My arrow indicator was correct, while my string variable wasn't always. After much cursing, I finally came to the conclusion that my loop analyzed the chart from front to back, and therefore it was giving me the first chronological indicator which was available to it. To fix this, I changed my loop to...
... which now reads it correctly.
But here is my issue:
In the first for loop which went backwards, I would get signal generation while the bar was being created -- I could tell because even though the string was incorrect, arrows were still being generated on the chart. For example, if the 2nd bar was positive but then went negative, it would show me the positive indicator, and then take it away once it went negative. The second for loop works correctly; however, it does not show the signal while it is being generated... it will only show the signal after the bar is complete. How do I fix the second loop so that it will show the signal as it is being created?
Thank you.