Jump to content
Medved Trader Forums

How to draw a arrow

Recommended Posts


I am trying to replicate the code on https://www.prorealcode.com/prorealtime-indicators/hikkake-pattern/ for the Paintbar to make my own indicator.

But I am a little confused how to draw an arrow and I can't seem to find any examples. My code at the moment is

I am not sure how to get the graphics engine and such to pass into DrawArrowUp and how to do the calculations for the X,Y.


public void MainCalculation()
    bool HikakkeBull     = false;
    bool WithinTimeLimit = false;
    double InsideBullBarHigh;
    int InsideBarNumber;
    int HikakkeBarNumber;
    if (High[1] < High[2] && Low[1] > Low[2]) {
        HikakkeBull       = true;
        InsideBullBarHigh = High[1];
        InsideBarNumber   = candleIndex - 1;
        HikakkeBarNumber  = candleIndex;
    if (HikakkeBull) {
        WithinTimeLimit = (candleIndex - HikakkeBarNumber) <= 3;
        if (Close > InsideBullBarHigh && WithinTimeLimit) {
            Color upArrow = Color.Green;
            DrawArrowUp(g, upArrow, candleIndex)
            HikakkeBull = false;


Link to comment
Share on other sites

You cannot get into graphics from paintbar. Paintbar can do either of 3 things.

A. Draw a colored bar or shape either in a band or above/below candle

B. Draw one line or a band - two lines with color in between

C. Draw a straight line or several lines on the chart


What you need is covered by A above. Just set the Color to green or red in the paintbar and set the shape to up or down arrrow. Then once you put the paintbar on the chart, tell it to display above or below the candle. Can't have the same paintbar display both below and above candle, but that's minor.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...