SetTriggerBarClose 在日线周期上不能触发
请老师帮看一下,为什么我的代码在日线周期上不能 收盘前触发预警,收到预警还是晚上开盘的时候。Params Numeric AlertSound(1); // 预警声音类型(可选)Vars Bool AlertCondition(false); // 预警触发条件 Series<Numeric> PreviousHigh(0); // 记录上一根K线的最高价EventsOnInit(){ array<Numeric>timepoint; timepoint=0.145950; SetTriggerBarClose(timepoint);}OnBarclose(ArrayRef<Integer> indexs){ // 记录上一根K线的最高价 PreviousHigh = high[1]; // 核心逻辑:判断当前K线的收盘价是否高于上一根K线的最高价 AlertCondition = (Close > PreviousHigh); // 如果预警条件触发 If (AlertCondition) { // 1. 在注释框输出详细提示信息 Commentary("【价格上破预警】时间:" + Text(Date) + " " + Text(Time) + ", 当前收盘价:" + Text(Close) + " < 前一根K线最高价:" + Text(PreviousHigh,2)); // 2. 在图表上绘制向下箭头标记,直观显示预警位置 PlotString("S", "↓", High + 1 * MinMove * PriceScale); // 3. 触发系统声音预警(如果平台支持且用户开启) //PushStatusMsg("收盘价低于上一根K线的最低价"); // 可根据需要取消注释 Alert(A_GetOrderCreateSource()+":收盘价高于上一根K线的最高价"); }