Unable to see data from today in Explore

I am using below afl to show results from data updated during market hours, but the afl is showing data from previous day. How can i get this to show data of today only?


image

// Define the breakout line
BreakoutLine = Study("BO", 1427);

// Calculate PDiff, setting it to Null if BreakoutLine is Null or Close is 0
PDiff = IIf(Close == 0, Null, (Close - BreakoutLine) / Close * 100);

// Calculate percentage difference, handling Null values or zero Close
//PDiff = IIf( IsNull( BreakoutLine ) OR Close == 0, 0, ( Close - BreakoutLine ) / Close * 100 );

// Define colors based on PDiff, with colorDefault for Null values
ColorDiff = IIf(IsNull(PDiff), colorDefault,
            IIf(PDiff > 2, colorRed,                // Red: PDiff > 2%
            IIf(PDiff >= -5 AND PDiff <= 2, colorGreen, // Green: -5% <= PDiff <= 2%
            IIf(PDiff > -10 AND PDiff < -5, colorOrange, // Orange: -10% < PDiff < -5%
            colorGrey40))));                        // Grey: PDiff <= -10% or other cases

// Volume multiplier calculation
VolPeriod = 30;
VolMul = Volume / ( MA( Volume, VolPeriod ) + 1e-9 ); // Add small constant to avoid division by zero
ColorVol = IIf( VolMul > 2, colorGreen, IIf( VolMul > 1, colorOrange, colorGrey40 ) );

// Rate of Change (ROC) coloring
RocCol = IIf( ROC( Close, 1 ) > 0, colorGreen, IIf( ROC( Close, 1 ) < -2, colorRed, colorOrange ) );

// Function to retrieve RS ranking (from IBD_RS_Ranking.afl)
function GetRS( Symbol )
{
    return StaticVarGet( "RS1_" + Symbol );
}

// Check if stock is in specific watchlists
READY_TO_BUY = IIf( InWatchListName( "READY_TO_BUY" ), True, False );
RECENT_IPOS = IIf( InWatchListName( "RECENT_IPOS" ), True, False );
STAGE_1 = IIf( InWatchListName( "STAGE_1" ), True, False );

// Create a string to display watchlist names
Watchlist = WriteIf( READY_TO_BUY, "READY_TO_BUY",
				WriteIf( RECENT_IPOS, "RECENT_IPOS",
					WriteIf( STAGE_1, "STAGE_1",
            
            " " ) ) );

// Check if the stock is in "PullBackTradingSystem" or "RECENT_IPOS" watchlist
InPullBack = InWatchListName( "PullBackTradingSystem" ) OR InWatchListName( "RECENT_IPOS" );

// Identify the last bar
LastBar = BarIndex() == BarCount - 1;

// Set Exploration filter: only last bar for stocks in watchlist with specific conditions
//Filter = InPullBack AND LastBar AND ROC( Close, 1 ) > 1.8 AND VolMul >= 0.25;
Filter = InPullBack AND LastBar;

// Add columns to Exploration window
AddColumn( Close, "Close", 1.2 );
AddColumn( ROC( Close, 1 ), "ROC Yest", 1.2, colorWhite, RocCol );
AddColumn( VolMul, "Vol Mul", 1.3, colorWhite, ColorVol );
AddColumn( GetRS( Name() ), "RS", 1 ); // RS ranking column
AddTextColumn( Watchlist, "Watchlist" );
AddColumn( PDiff, "DisttoBreakout", 1.2, colorWhite, ColorDiff ); // Add percentage difference column
AddColumn( BreakoutLine, "Breakout Line", 1.2 ); // Display raw BreakoutLine values for debugging
AddTextColumn( IndustryID( 1 ), "Industry name" );
AddTextColumn( SectorID( 1 ), "Sector name" );


// Sort by RS column (descending)
SetSortColumns( -4 );

see the date and its settings in the Analysis window

Sorry, could not understand your suggestion but assuming you are suggesting to check if Range is set to 1 recent bar(s)?
i tried all 3 options, 1 recent bar(s), 1 recent day(s), from to dates with dates set to today's date
still seeing no data from today

test with another AFL. make sure you save the settings as APX and then use it. proper periodicity etc
without any more info, it is hard to tell.

Analysis1.apx (9.6 KB)
Thanks, attaching apx also in case you would like to take a look.

I dont have the issue, i get 10-march as output
what is your data source?

My source is Amiquote end of day database, using yahoo, running every 15 minutes periodically

When you provide screenshots -don't truncate them. No-one knows what range you use if you truncate screenshot so "Range" setting is OUT of sight.

The Settings file shows that you are using ^NSEI as "Pad and align" reference symbol.

This means that ALL DATA are padded and aligned to that particular symbol. If that symbol is NOT updated and does NOT have data from "today", you won't see any results for today, but only see dates that are PRESENT in reference symbol

Make sure to update ^NSEI with todays data or turn off padding.

1 Like