I want to draw an up-arrow below the price bar when MACD crosses above the signal line and above the zero line. Please kindly help me with this as I am not very familiar with the programming code and search through the guides to no avail.
Many thanks in advance.
Hi GraHal,
Thanks for the update. But I have some issues defining the conditions.
if C>D and D>=C and D>E, how do I define this condition and get the program to draw an arrow above or below the bar?
Many thanks for your prompt reply and help.
Regards, Derick.
Hi Derick
I’ve never coded DrawArrow, so I doubt below is fully correct and / or correct syntax, but something like below.
The gist of below is … if conditions are met then Draw Arrow (as per the link in #39963)
If C>D and D>=C and D>E Then
DRAWARROW(barindex, close) COLOURED(0,100,255,255)
endif
Let us know how you get on?
Cheers
GraHal
Hi GraHal,
Tried the above as per suggested, it does not work. 🙁
I think there should be some syntax error some where.
Regards, Derick.
AVTParticipant
Senior
Here is an example:
// --- 1. possibility: variable holding the condition and test the variable
// advantage: simple change condition in variable
// disadvantage: one variable more
//Popgun=(high[0]>high[1] AND low[0]<low[1] AND high[1]<high[2] AND low[1]>low[2])
//IF Popgun THEN
// --- 2. possibility: put the complete condition into ( )
// advantage: one variable less
// disadvantage: long search through code if you need changes
IF ( high[0]>high[1] AND low[0]<low[1] AND high[1]<high[2] AND low[1]>low[2] ) THEN
DRAWARROW(barindex,low) COLOURED(255,0,0) // right pointing arrow at low of candle
DRAWARROWUP(barindex,low-5) COLOURED(0,0,255) // up pointing arrow a bit below the low of candle
DRAWARROWDOWN(barindex,high+5) COLOURED(0,0,255) // down pointing arrow a bit above the high of candle
ENDIF
Return
If you don’t see any arrows made by your code, think of the chance that your conditions are simple not met to be true.
Hope it helps.
Hi Derick
Use GRAPH to see if / when your conditions are being met (as AVT says).
Also my code (incorrectly) shows a space before the close … is that giving you the syntax error?
Also my colour has 4 shades, so try 3 and make sure it not same colour as your background else you not see the Arrow!? 🙂