I'm looking to get the below code working for charts with a higher timeframe than Daily.
I would like AmiBroker to run a check that the selected ParamDate is an actual trading day. The below code I wrote works fine but only on Daily charts. As TimeFrameSet is only for higher timeframes I'm struggling to find a solution to get AmiBroker to access the dates for each Daily bar when on say a Weekly or Monthly chart.
Any help would be much appreciated - thanks.
// Check that selected ParamDate is an actual traing day (check over all loaded daily bars)
entryDate_dn = ParamDate("Entry Date:", Now(1), format = 0);
entryDate_dt = DateTimeConvert(2, entryDate_dn);
entryDate_str = DateTimeToStr(entryDate_dt, 4);
entryDate_search = Lookup(entryDate_dn, entryDate_dt, 0);
entryDate_IsInvalid = IsNull(entryDate_search);
errorText = WriteIf(entryDate_IsInvalid, "Invalid Entry Date!", "Entry Date OK");
GfxSetOverlayMode(mode = 0) ;
GfxSelectFont("Segoe UI", 12, 600);
GfxSetBkMode(1);
GfxSelectSolidBrush(colorLightBlue);
GfxRoundRect(10, 80, 600, 120, 20, 20);
GfxDrawText(errorText, 10, 80, 600, 120, 1 | 4 | 16 | 32);