Jump to content
Medved Trader Forums

GLB Breakout - line


Recommended Posts

On the wishingwealth blog the guy there has created some simple indicators and one he calls the Green Line Brekaout (GLB).    Essentially he draws a horizontal green line on a chart where a stock has hit a new high then pulled back for at least 3 months and is under that high; then he enters on a break of that line (at least in some cases).

It's drawing a line at all time highs but only if the high was > 90 days ago.   Is there a way to draw that horizontal line. 

Thanks

Link to comment
Share on other sites

This is for a historical chart, right?

StateFIFOQueue Highs;
Double AllTimeHigh = 0;

public void MainCalculation()
{
    AllTimeHigh = Math.Max(AllTimeHigh,High);
    Highs.Add(High);
    Double H,L;
    Highs.GetHighLow(out H, out L);
    SetColor("Line Color",  Color.Green);
    if (H == AllTimeHigh)
        SetYValue(H);
    else
        SetYValue(YSkipValue);
}

/// <summary>
/// Is called at start of paintbar calculation, should be used to initialize anything needed for the paintbar
/// </summary>
private void PaintbarInitialize()
{
    Highs = new StateFIFOQueue(90);
}

/// <summary>
/// Is called at start of paintbar calculation, should be used to clear the paintbar state
/// </summary>
private void PaintbarClearState()
{
    Highs.Clear();
}

/// <summary>
/// Saves paintbar state (called internally).
/// </summary>
private void PaintbarSaveState()
{
    Highs.SaveState();
}

/// <summary>
/// Restores paintbar state (called internally).
/// </summary>
private void PaintbarRestoreState()
{
    Highs.RestoreState();
}


 

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