dimanche 30 octobre 2016

I want to count when singnal (i.e. breakout, cross) happen.

So sorry for my English.
I want to count when signal happen and collect them into 1 bar per day.
Like a frequence of something. Example I have 100 stocks for my universe are show for breakout 25 stocks in this day. I want to show them in a bar in indicator window in everyday.

this are code i think it should be.
//////////////////////////////////////
function BBCheck( price )
{
BBTop = BBandTop(price,20,1);
BBBot = BBandBot(price,20,1);

return price < BBBot;
}

listnum = Param("Watchlist", 37, 0, 500,1);
list = GetCategorySymbols( categoryWatchlist, listnum );
count = 0;
x = 0;

for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
price = Foreign( sym, "C" );

x = BBCheck(price);
IIf(x==1, count + 1,do nothing);
}
Plot(count,"UnderBB",colorRed,styleHistogram | styleThick, maskHistogram);
///////////////////////////////////////////


I want to count when singnal (i.e. breakout, cross) happen.

Aucun commentaire:

Enregistrer un commentaire