how to draw an object above or below a candle
Forums › ProRealTime English forum › ProBuilder support › how to draw an object above or below a candle
- This topic has 6 replies, 3 voices, and was last updated 7 years ago by GraHal.
-
-
07/06/2017 at 6:35 PM #39962
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.
07/06/2017 at 7:06 PM #39963Is below any help or a start anyway?
07/07/2017 at 10:25 AM #40008Hi 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.
07/07/2017 at 11:32 PM #40060Hi 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)
123If C>D and D>=C and D>E ThenDRAWARROW(barindex, close) COLOURED(0,100,255,255)endifLet us know how you get on?
Cheers
GraHal07/08/2017 at 4:57 PM #4009507/08/2017 at 6:07 PM #40103Here is an example:
draw arrow if condition12345678910111213141516// --- 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 changesIF ( high[0]>high[1] AND low[0]<low[1] AND high[1]<high[2] AND low[1]>low[2] ) THENDRAWARROW(barindex,low) COLOURED(255,0,0) // right pointing arrow at low of candleDRAWARROWUP(barindex,low-5) COLOURED(0,0,255) // up pointing arrow a bit below the low of candleDRAWARROWDOWN(barindex,high+5) COLOURED(0,0,255) // down pointing arrow a bit above the high of candleENDIFReturnIf 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.
1 user thanked author for this post.
07/08/2017 at 7:25 PM #40116Hi 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!? 🙂
-
AuthorPosts
Find exclusive trading pro-tools on