Pivot Point Indicator with Arrows for signal - page 2

 
UniPivotDev:

Price close is the closed price of a bar is it not? So what I am trying to get the code to do here is to output an arrow above a bar which has closed above the price of where the R1Buffer was generated using the pivot point calculations. What keeps occurring here now is that once the closed bar closes above R1 an arrow is still not displayed and I can't seem to figure out why.

 

Anyways since then I've opted to use the following method:

 Which means the variable array MakeArrow[i] is assigned the value of Open[i], meaning that when the Open[i] opens above R1 an arrow should be outputted. This is a syntax that would be accepted in usual C++/C# but MQL4 is not performing the function as I would expect.

Try this . . .

MakeArrow = Open[i];
         
         if(MakeArrow >= R1Buffer[i])
            ExtMapBuffer2Down[i]=High[i]+5*Point;
         else
            ExtMapBuffer2Down[i]=0.0;

 

 
Okay that makes sense now that I've checked it 'Price_close' is a constant and a such the value won't chance to correlate with any change in price in the current market. Open[] on the other hand I believe should be able to make a relation between the current open price or most recent price and the value in the data buffer for R1Buffer, meaning the If-Statement should be accepted and an arrow should be presented but this isn't the case. Could you please a look at my sourcecode and try and execute the indicator to suggest what might be the reason for this. I would really appreciate it.
        if(Open[i]==R1Buffer[i])
            ExtMapBuffer2Down[i]=High[i]+5*Point;
            
         else if(Open[i]!=R1Buffer[i])
            ExtMapBuffer2Down[i]=0.0;
            //ExtMapBuffer1Up[i]=Low[i]-15*Point;
Here is where I tried to make the ammendment
Files:
attempt2.mq4  5 kb
 
I have attempted the approach you just suggested but the same thing still occurs, the arrows do not appear above bars that have exceeded the R1 price data buffer. This is strange as I know theoretically this should work out in practice it's not working.
 
UniPivotDev:
Okay that makes sense now that I've checked it 'Price_close' is a constant and a such the value won't chance to correlate with any change in price in the current market. Open[] on the other hand I believe should be able to make a relation between the current open price or most recent price and the value in the data buffer for R1Buffer, meaning the If-Statement should be accepted and an arrow should be presented but this isn't the case. Could you please a look at my sourcecode and try and execute the indicator to suggest what might be the reason for this. I would really appreciate it.
Your modified code is outside of the for loop . . . so it is only executed when the loop has finished.
 
Could you send me the full source code for the one you just implemented as it appears yours seems to be working, not sure why mine is not showing the same results. Thanks
 
UniPivotDev:
Could you send me the full source code for the one you just implemented as it appears yours seems to be working, not sure why mine is not showing the same results. Thanks

I already told you why . . .

RaptorUK:
Your modified code is outside of the for loop . . . so it is only executed when the loop has finished.

 
I have just done as you said and it now appears to be working, thanks for the tips and help man, much appreciated.
 
UniPivotDev:
I have just done as you said and it now appears to be working, thanks for the tips and help man, much appreciated.
Cool . . . so you learned something along the way too.  Well done for trying.
 
Yes I've learnt a lot from this I'll continue to develop on this code now as I have a better understanding of it. Thanks again for the help.