Exploration for Buy and Sell at particular time

Good Morning, Afternoon, Evening friends. I am new to AFL. Working on Exploration for simple condition. Buy at 920 AM and Sell at 310 PM Intraday.

Written below code but not able to get result. It is coming blank row? Any suggestion. Do I need to use timeframe?

// Define the trading time for Buy and Sell
BuyTime = TimeNum() == 092000;  // Buy at 9:20 AM
SellTime = TimeNum() == 152000;  // Sell at 3:20 PM

// Define the Buy and Sell Conditions
Buy = BuyTime;
Sell = SellTime;

// Buy with 2 lots
PositionSize = 2 * 100;  // Assuming each lot is 100 shares

// Define the Stop Loss
BuyPrice = ValueWhen(Buy, Close);  // Entry price at Buy signal
StopLoss = BuyPrice - 4;  // Stop loss 4 points below BuyPrice

// Exit if price hits stop loss before 3:20 PM
Sell = IIf(Close <= StopLoss, 1, Sell);

// Capture Sell Price at the time of Sell
SellPrice = ValueWhen(Sell, Close);

// Calculate Profit/Loss per share
PL = IIf(Sell, (SellPrice - BuyPrice) * PositionSize / 100, 0);  // Adjusted for 2 lots

// Exploration columns for the report
Filter = Buy OR Sell;  // Only show rows where buy or sell occurs
AddColumn(BuyPrice, "Buy Price", 1.2);
AddColumn(SellPrice, "Sell Price", 1.2);
AddColumn(PL, "Profit/Loss", 1.2);

I could able to achieve by reading and exploring through User Guide and practicing. It is simple code in the end. Find below. I could able to backtest on profit via backtest as well. Scan provide perfect, buy and sell price at respective times.

Buy = TimeNum() == 093000;
Sell = TimeNum() == 151500;

//Buy = ExRem(Buy,Sell);
//Sell = ExRem(Sell, Buy);
BuyPrice = ValueWhen(Buy,C);
SellPrice = ValueWhen(Sell,C);

Filter = Buy OR Sell; // show all bars
//AddColumn( Buy, "Buy" );
//AddColumn( Sell, "Sell");
AddColumn( BuyPrice, "Entry");
AddColumn( SellPrice, "Exit");

You don't need ValueWhen in your code to set buyprice/sellprice

BuyPrice = Close;
SellPrice = Close;

Don't use ValueWhen here. BuyPrice and SellPrice are ARRAYS and AmiBroker picks array element at the time of the entry/exit automatically.