Drawing arrows for an indicator in Prorealtime
Forums › ProRealTime English forum › ProBuilder support › Drawing arrows for an indicator in Prorealtime
- This topic has 5 replies, 2 voices, and was last updated 1 hour ago by
Ahimsa.
-
-
09/29/2025 at 4:34 PM #251999
Hi everyone,
It’s lovely to cyber meet you all. Please accept my apologies for the fact that no photo shot of me is showing yet. I have uploaded an image.
I don’t know if anyone else is having the same problem as me, but I’m trying to write an indicator based on a strategy. Basically it will return arrows on the chart for buy and sell signals. The idea is that this indicator will then be connected to a Python bridge that links to IG’s API. This is the only way I can work with strategies in Prorealtime that reference x-volume candles instead of timebased ones. I’m using a 100 volume chart.
The thing is, I can’t seem to get Prorealtime to draw any arrows on the chart. I’ve added the code for a simple test program I have tried. This is just to try and get Prorealtime to draw a green arrow when a bullish candle crosses the SMA 21. This program will run but no candles are drawn on the chart! Does anyone know why? Many thanks in advance.
// Simple Test Program: Check if the last bullish candle crosses SMA 21
// Define the period for the SMA
SMA21 = Average (21)// Check if the last candle is bullish (close > open)
isBullishCandle = close[1] > open[1]// Check if the last bullish candle crosses above the SMA 21
crossAboveSMA21 = close[1] > SMA21[1] AND open[1] < SMA21[1] // Entry Condition: Bullish candle crossing SMA 21 entryCondition = isBullishCandle AND crossAboveSMA21 // Draw Green Up Arrow when the entry condition is met IF entryCondition THEN DRAWARROWUP(barindex[1], low[1] - 5) COLOURED(0, 255, 0, 255) // Green arrow up, fully opaque, placed 2 points below the low of the previous candle ENDIF // End of the indicator - Return to finish the code RETURN09/29/2025 at 4:46 PM #252001I’m sorry that the bottom bit of code has got compacted. I’ll make it easier to read.
// Check if the last bullish candle crosses above the SMA 21
crossAboveSMA21 = close[1] > SMA21[1] AND open[1] < SMA21[1]// Entry Condition: Bullish candle crossing SMA 21
entryCondition = isBullishCandle AND crossAboveSMA21
// Draw Green Up Arrow when the entry condition is met
IF entryCondition THEN DRAWARROWUP(barindex[1], low[1] – 5) COLOURED(0, 255, 0, 255) // Green arrow up, fully opaque, placed 2 points below the low of the previous candle ENDIF
// End of the indicator – Return to finish the code
RETURN
09/29/2025 at 5:00 PM #252002Hi,
I guess your indicator is in subwindow below the price window, rather than inside the price window itself? If that’s the case, then you need to take into account that only what’s asked to be drawn in the final return line is used to dimension that window, not the graphic objects from commands DRAWxx like arrows. So your arrows are probably drawn, but outisde the edges of the subwindow. You could do one of 2 things:
Either you still wish a separate pane, so you need to add something to the return line (for example: return sma21) in order to give the window dimensions more likely to display the arrows
Or you could add to the price window your indicator with its empty return line unchanged, instead of below it.
09/29/2025 at 5:10 PM #252004Hi JC Bywan
That was a very prompt response, thank you!
No I’m adding my indicator to the price window where all my x-volume candles based on 100 volumes are being formed. I’m also tried adding the indicator to a time based price chart instead of an x-volume based one. The arrows are still not being drawn. I’m quite mystified.
Thanks for trying to help though.
Best wishes
Ahimsa
09/29/2025 at 5:20 PM #25200509/29/2025 at 5:36 PM #252006 -
AuthorPosts
Find exclusive trading pro-tools on