Jump to content
Medved Trader Forums

Recommended Posts

Can someone inform me how to create a new scanner with these criteria:
1. scan to see if there is a new 24 low within 2% or less
would like to do this in simple view please...

 

Share this post


Link to post
Share on other sites

Ok - in simple mode you cannot do that. Just no prepared variable to simply compare it.

 

In advanced mode (and let's say 1-min chart mode), you create a state object of type FIFOQueue of size 24*60, and add to it the close of the current candle, then call the GetHighLow function to find the high and the low for the last 24*60 minutes.

And of course, to check if it is within 2% of the low in the 24 hr range you would check if   (Close-Low24)/(High24-Low24)<=0.02

If you don't think you can do it yourself, I'll throw it together and post it here.

 

Share this post


Link to post
Share on other sites

ok that would be great if you can...
Because only use about 2 - 3 indicators

This is what I am trying to create 2 scans:
1. EMA w/ MACD method
search for symbols where 1 candle before the EMA13 has crossed the EMA34 upwards and the MACD is above the 0.0 line and volume is 100,000 or more...

2. MFI and MACD method
scan for symbol where the MFI 80/20 is below the 20 line and the MACD hashes are red going to green or closed red going to open red and volume is 100,000 or more...

I have noticed also there are no unfiled hashes on the MACD, why? this is an important signal to show a weakening in momentum also...

Share this post


Link to post
Share on other sites

yes normally on the MACD hashes are 
green > filled green or red > filled red
the filled in hashes represent the momentum slowing down...
so what i need is when the MACD goes from red > filled in red and red to green
you can see an example of this if you go on https://cryptowat.ch/bitfinex/btcusd they show the different hashes on their charts. Binanace also has them too, this is very helpful for entry and exit points in a trade very high success rate of profiting.

Share this post


Link to post
Share on other sites
4 hours ago, cryptonight said:

you can see an example of this if you go on https://cryptowat.ch/bitfinex/btcusd they show the different hashes on their charts. Binanace also has them

That's a first for me watching it snow on a price chart. lol

Are you talking about this red and green line where the price is currently? If so I like that.

5a3e724357cab_ScreenHunter_01Dec_2310_11.jpg.6ef5db52cfd42ae05504548c638a3144.jpg

Share this post


Link to post
Share on other sites

ok can you create an advanced scan that will:
1. scan for volume over 100,000
2. scan for MFI under 20
3. scan for MACD over 0.000000

scan must meet all 3 criteria to output...
also is there a way for user to get an email or sms when there is an alert???

Share this post


Link to post
Share on other sites

is this correct, I took a stab and tried it:
public void MainCalculation()
{
    if (MFI_Main < 20.00 && MACD_Main > 0.00000000 && Volume_Bar >= 100000)
    {
        SetScanResult("Positive") ;
    }
}

Edited by cryptonight

Share this post


Link to post
Share on other sites

That looks good (depending on how you defined those vars but I presume those are defaulted).

 

Run it not as a scan, but as a paintbar (obviously replacing SetScanResult with SetColor) and check on a chart if it catches those conditions.

 

 

Share this post


Link to post
Share on other sites

The scan and paintbar code can be shared. You can run your scan as a paintbar (putting it SetColor instead of the TriggerAlert) and it will show up on the chart.

 

For daily high, use SymbolData.High,  for low SymbolData.Low  - all these can be found in the simple editor's combo box lists.

Share this post


Link to post
Share on other sites

1. For daily high, use SymbolData.High,  for low SymbolData.Low
But how will I get the scanner to look for a new LOW or HIGH, won't I have to compare it to something please give example... thanks

2. Also if I want to only scan symbols with a certain volume which volume would i use the SymbolData.Volume???

Share this post


Link to post
Share on other sites

1.  if you want to look for new high, you would have to check the State-stored previous high to current SymbolData.High, then save the current High to the State-stored previous high.

2. SymbolData.Volume is the cumulative volume for the current session

 

 

Share this post


Link to post
Share on other sites

If you want specifically NEW low (and not just at the low), you can't do it in basic.

 
 
/// <summary>
/// Is called at start of paintbar calculation, should be used to initialize anything needed for the paintbar
/// </summary>
private void PaintbarInitialize()
{
 
}
 
/// <summary>
/// Holds paintbar state - fill with variables needed to be preserved for next paintbar calc
/// </summary>
private struct PaintbarState
{
   public Boolean IsNewLow;   
   public Double PrevLow;
}
 
/// <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
/// </summary>
private void PaintbarClearState()
{
    CurrentState.IsNewLow  = false;
    CurrentState.PrevLow = 0;    
}
 
/// <summary>
/// Saves paintbar state (called internally).
/// </summary>
private void PaintbarSaveState()
{
   SavedState = CurrentState;
}
 
/// <summary>
/// Restores paintbar state (called internally).
/// </summary>
private void PaintbarRestoreState()
{
   CurrentState = SavedState;
}
 
public void MainCalculation()
{

    if ((Close == SymbolData.Low AND CurrentState.IsNewLow) OR Close<CurrentState.PrevLow)
    {
        SetScanResult("New Low");
        CurrentState.IsNewLow = true;
        CurrentState.PrevLow  = Close;
    }
    else 
        CurrentState.IsNewLow = false;
 
}

 

 

Share this post


Link to post
Share on other sites

hello is there a way to scan and check when a candle goes from red to green???

I am trying to find when a symbol dips down to its low points before it starts to go up...
I have so far, but this only catches the symbol at its lowest point. I am trying to catch it when it's going up so when the MACD > 0.0 also???
So how can I scan for these parameters and then show when MACD > 0 which usually comes after...

public void MainCalculation()
     { if (Volume_Bar > 500 && (RSI_Line <= 30 || MFI_Line <= 20) && EMA_Line13 < EMA_Line34)
          { SetColor("Buy NOW!", SysColor.Positive);
     SetScanResult("Buy NOW!");
return; } }

Edited by cryptonight

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×