Own candlestick Chart

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #177878 quote
    IG_CFD_Trader
    Participant
    Average

    Hello PRT experts,

    Is it possible to combine a series of candles from a 1Hr chart to create our own candlestick chart?

    Please note that this is different than using a different timeframe to achieve same, because in PRT the timezone is set and can only be altered globally and not individually.

    For example, I want to combine the last 4 bars on a 1Hr chart together and draw them as a single bar. Note this is different than simply looking at 4hr chart (every 1 bar) or 15min chart (every 4 bars).

    I would appreciate any expert input.

    Stay Safe and my best regards

    #177883 quote
    robertogozzi
    Moderator
    Master

    There can’t be holes in between candles, so you will have to:

    1. use DRAWCANDLE to plot a white candle so that the original one (almost) disappears
    2. use DRAWCANDLE to plot, in the 4th hour’s place, the combined OHLC values, the lowest LOW, the highest HIGH, the first OPEN, the last CLOSE.

    Try this (not tested):

    DRAWCANDLE(Open,High,Low,Close) COLOURED(255,255,255,255) BORDERCOLOR(255,255,255,255)
    If openhour MOD 4 = 0 then
       O4 = open
       H4 = high
       L4 = low
    Endif
    H4 = max(high,H4)
    L4 = min(low,L4)
    If openhour MOD 4 = 3 then
       C4 = close
       DRAWCANDLE(O4,H4,L4,C4)
    Endif
    RETURN
    #177890 quote
    robertogozzi
    Moderator
    Master

    This is slightly better:

    Size1 = 1.01
    Size2 = 0.99
    DRAWCANDLE(High*Size1,High*Size1,Low*Size2,Low*Size2) COLOURED(255,255,255,255) //BORDERCOLOR(255,255,255,255)
    If (openhour MOD 4 = 0) OR (IntraDayBarIndex = 0) then
       O4 = open
       H4 = high
       L4 = low
    Endif
    H4 = max(high,H4)
    L4 = min(low,L4)
    If openhour MOD 4 = 3 then
       C4 = close
       DRAWCANDLE(H4*Size1,H4*Size1,L4*Size2,L4*Size2) COLOURED(255,255,255,0) //BORDERCOLOR(255,255,255,255)
       r = 255
       b = 0
       IF C4 > O4 THEN
          r = 0
          b = 255
       ENDIF
       DRAWCANDLE(O4,H4,L4,C4) coloured(r,0,b,255)
    Endif
    RETURN
    x-10.jpg x-10.jpg
    #177905 quote
    IG_CFD_Trader
    Participant
    Average

    tnx mate 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Own candlestick Chart


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
IG_CFD_Trader @wnakhoul Participant
Summary

This topic contains 3 replies,
has 2 voices, and was last updated by IG_CFD_Trader
4 years, 4 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 09/19/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...