等级: 免费版
- 注册:
- 2022-1-11
- 曾用名:
|

楼主 |
发表于 2023-6-7 14:26
|
显示全部楼层
input: Length(135);
variable:Support:=0;
variable:Support1:=LLV(c,Length);
variable:Resistance:=0;
variable:Resistance1:=HHV(c,Length);
//---------------------------------Formula-------------------------------------------
if Cross(close,MA(high,length)) then Support:=Support1;
if Cross(MA(Low,Length),close) then Resistance:=Resistance1;
//--------------------------------Entry--------------------------------------------
if Resistance > ref(Resistance,1)
and close < Resistance
and close < MA(c,100)
then begin 开空: BUYSHORT(HOLDING=0,200/(Resistance-close),MARKET,OPEN);
end;
if Support < ref(Support,1)
and close > support
and close > MA(c,100)
then begin 开多: BUY(HOLDING=0,200/(close-support),MARKET,OPEN);
end;
//--------------------------------Stop loss at Support------------------------------
if holding>0 AND CLOSE<SUPPORT
then begin 平多: SELL(HOLDING>0,100%,MARKET,OPEN);
end;
if holding<0 AND CLOSE>RESISTANCE
then begin 平空: SELLSHORT(HOLDING<0,100%,MARKET,OPEN);
end;
|
|