欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。
加粗语句改动,试试是否正确。
runmode:0;
input:a(105,100,199);
variable:lastp=0;
if c<o then begin
buy(holding=0,100%,thisclose);//如果收盘小于开盘 且 空仓 就在该日收盘位全仓买入。
lastp:=c;
end;if (c-lastp)/lastp>=((a-100)/100) then begin sell(holding>0,100%,thisclose);//如果持仓且收盘价大于买入价5%,则全仓卖出。 end;