Jump to content
Medved Trader Forums

New High of the Day scanner with Volume condition


Recommended Posts

Hi

I am new to Medved Trader software and stuggling to create a scanner but no luck. scanner for day tradding so only intraday 

I want to create a scanner when a stock price crosses up the high of the day (stocks setting new intraday highs) and the stock has atleast volume of 300,000.

any help would be highly appreciated. if I can have a complete set of rules and condition in paintbar that would be PERFECT.

Thanks in advance

Link to comment
Share on other sites

The problem is most likely the "crosses up the high" thing - in the case of the high, the price cannot cross up since as soon as price is above the high the high becomes that price. So best that you can do is price equal to high. Does that work?  you may want to check a little more broadly, like if price is within 0.01 of high

float is not currently available. 

 

  • Like 1
Link to comment
Share on other sites

Thank you for the quick response, I am having this exact problem you mentioned. but its been just a week I am using Medved and I dont know how to do these thing.

I can leave float but I still need want a condition of volume. can you please provide me something in detail how to create the above scanner with 0.01 of high with the volume condition, I can tweat with it and will try to adjust.

Thanks a lot for your help.

Link to comment
Share on other sites

yes please post it, I can try this one and use the time column to sort, hope it will work.

just wanted to make sure one thing 300k filter I want to use is for the whole day. for example if since 4:00am the volume is above 300k then the scanner will trigger the alert.

Thank you very much Mike

Link to comment
Share on other sites

In the code below, the part that is important is MainCalculation and the definition of the PaintbarState structure. The rest is automatically generated.

------------------------------------------------------------------------------------------------
/// <summary>
/// Holds paintbar state - fill with variables needed to be preserved for next paintbar calc
/// </summary>
private struct PaintbarState
{
    public int LastDayNum;
    public double CumulativeVolume;
    public double LastDailyHigh;
}

public void MainCalculation()
{
    if (TradingDay.DayNumber != CurrentState.LastDayNum)
    {
        CurrentState.LastDayNum       = TradingDay.DayNumber;
        CurrentState.CumulativeVolume = 0;
        CurrentState.LastDailyHigh    = 0;
    }
    CurrentState.CumulativeVolume += BarVolume;
    if (High > CurrentState.LastDailyHigh)
    {
        CurrentState.LastDailyHigh = High;
        if (CurrentState.CumulativeVolume > 300000)
        {
        // trigger alert
            TriggerAlert("High", "New Daily High!");
        }   
    }
}

/// <summary>
/// INITIALIZES paintbar. Is called at start of paintbar calculation, should be used to initialize anything needed for the paintbar
/// NOTE: do NOT initialize the CurrentState here - the PaintbarClearState will be called AFTER this call, and will wipe it out.
/// </summary>
private void PaintbarInitialize()
{

}


/// <summary>
/// Holds current PB state - use to calc PB, changes to it carry over to next PB calc
/// </summary>
private PaintbarState CurrentState;

/// <summary>
/// Holds saved PB state - internal
/// </summary>
private PaintbarState SavedState;

/// <summary>
/// Is called at start of paintbar calculation, should be used to clear the paintbar state
/// and initialize whatever variables you place into it. This is called AFTER PaintbarInitialize
/// </summary>
private void PaintbarClearState()
{
    CurrentState = new PaintbarState();
}

/// <summary>
/// Saves paintbar state (called internally).
/// </summary>
private void PaintbarSaveState()
{
    SavedState = CurrentState;
}

/// <summary>
/// Restores paintbar state (called internally).
/// </summary>
private void PaintbarRestoreState()
{
    CurrentState = SavedState;
}
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...