希望将最后的动作写入文件,通过action_note全局变量保证只写入一次,但实际上每TICK都会重写一次。
请问正确的方法是什么呢?
debugfile2提示在本模式下不能正确工作,我先忽略了。
运行模式:逐K(仅刷新最后一根)
variable : action_note = 0;
if islastbar() and action_note = 0 then begin
action_note := 1;
debugfile2('e:\latest_action.txt', latest_action, 0, 1);
end
globalvariable : action_note = 0,bj=0;
if islastbar() and action_note = 0 and bj=0 then begin
debugfile('e:\latest_action.txt', 'latest_atciont = %.2f',latest_action);
ac tion_note := 1;
bj:=1;
end
试试看这个
用在后台比较好