Jump to content
Medved Trader Forums

Display lines on a 1 minute chart for each 30 minute high and low?


tommyjames

Recommended Posts

Here is a paintbar that would do it (aren't paintbars neat?)

double High30 = 0;
double Low30  = Double.MaxValue;
double X1     = -1;
double X2     = -1;

public void MainCalculation()
{
    if (Timestamp[0].Minute % 30 == 0 || X1==-1)
    {
        High30 = High;
        Low30  = Low;
        X1     = CandleNumber;
        X2     = X1+0.5;
    }
    else
    {
        High30 = Math.Max(High30, High);
        Low30  = Math.Min(Low30, Low);
        X2     = CandleNumber+0.5;
    }
    SetLine(X1+0.1, SysColor.Positive, X1,High30,X2,High30);
    SetLine(X1+0.2, SysColor.Negative, X1,Low30,X2,Low30);
}

 

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.

Guest
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...