for that day over all stocks in my list:>>
Spend a little time looking at this example of gathering stats for an
entire watchlist in an Explore and you should be able to adapt it to
your needs. (Quite some time ago I tried to convince TJ to offer a new
variable type that persisted for the life of each "RUN" and then reset
, but TJ did not see the need.)
//GapStats for a specific Watchlist
// Remember to run against a SINGLE security to avoid iterations
against the same watchlist.
ListCount = 0; // Global Variable
GapUp2Pct = 0;
GapFilled = 0;
ClosedLower = 0;
function GapScanforWatchList( listnum )
{
list = GetCategorySymbols( categoryWatchlist, listnum );
Average = 0; // Local Variable to function
for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
ListCount++;
SetForeign(sym, fixup = True);
LocCondGap = O >= Ref(H, -1) * 1.02;
LocGapUp2Pct = Cum(LocCondGap);
GapUp2Pct = GapUp2Pct + LocGapUp2Pct; // Update Global
LocCondFillGap = LocCondGap AND L <= Ref(H, -1);
LocGapFilled = Cum(LocCondFillGap);
GapFilled = GapFilled + LocGapFilled; //
Update Global
LocCondClosedLower = LocCondGap AND C < O;
LocClosedLower = Cum(LocCondClosedLower);
ClosedLower = ClosedLower + LocClosedLower; // Update Global
}
return Average / i;
}
GapScanforWatchList( 23 );
PctFilled = GapFilled / GapUp2Pct * 100;
PctLower = ClosedLower / GapUp2Pct * 100;
lastbar = BarIndex() == BarCount - 1;
Filter = lastbar;
AddColumn(Listcount,"ListCount",1.0);
AddColumn(GapUp2Pct,"# 2% UpGaps", 1.0);
AddColumn(GapFilled,"# Filled",1.0);
AddColumn(PctFilled,"% Filled", 1.2);
AddColumn(ClosedLower,"# Lower",1.0);
AddColumn(PctLower,"% Lower", 1.2);
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
| Investment management software | Real estate investment software | Investment property software |
| Software support | Real estate investment analysis software | Investment software |
YAHOO! GROUPS LINKS
- Visit your group "amibroker" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
