合肥生活安徽新闻合肥交通合肥房产生活服务合肥教育合肥招聘合肥旅游文化艺术合肥美食合肥地图合肥社保合肥医院企业服务合肥法律

代写开拓者策略 代写金字塔策略公式

时间:2024-01-01  来源:合肥网hfw.cc  作者:hfw.cc 我要纠错


Inputs:
len1(20),len2(33),len4(6),len5(22),len6(20),len7(50);

variables:
UpBand(0),DownBand(0),countband(0),counttrades(0),buytrades(0),selltrades(0),level1(0),level2(0),level3(0),level4(0),level5(0),level6(0),level7(0);

if time_s>93000 then 
begin
if countband=0 then 
begin
UpBand=Highest(high,20)[1];
DownBand=lowest(low,20)[1];
countband=1;
end;
if counttrades<200 then 
begin

if close crosses over UpBand and time_s<145000 and ADX(20)>len2 and AverageFC(close,len4)>AverageFC(close,len5)  and AvgTrueRange(len6)>AverageFC(AvgTrueRange(len6)[1],len7)
then
begin
buy 1 shares next bar at market;
counttrades=counttrades+1;
 buytrades=buytrades+1;
end;

if close crosses under DownBand and time_s<145000 and ADX(20)>len2 and AverageFC(close,len4)<AverageFC(close,len5) and AvgTrueRange(len6)>AverageFC(AvgTrueRange(len6)[1],len7)
then
begin
sellshort 1 shares next bar at market;
counttrades=counttrades+1;
selltrades=selltrades+1;
end;

end;

 condition1=(AverageFC(close,len4)>AverageFC(close,len5)and marketposition=-1); 
 condition2=(AverageFC(close,len4)<AverageFC(close,len5)and marketposition=1); 
 
 switch(contractprofit)
 begin   
  case 4500 to 10000 :
  level1=1;
  print(currentbar,"----","level1");
  case 10001 to 20000:
  level1=0;level2=1;
  print(currentbar,"----","level2");
  case 20001 to 30000:
  level2=0;level3=1;
  print(currentbar,"----","level3");
  case 30001 to 50000:
  level3=0;level4=1;
  print(currentbar,"----","level4");
  case 50001 to 70000:
 level4=0;level5=1;
 print(currentbar,"----","level5");
  case 70001 to 90000:
  level5=0;level6=1;
  print(currentbar,"----","level6");
  case 90001 to 140000:
  level6=0;level7=1;
  print(currentbar,"----","level7");
end;
 
 if condition1 or condition2 
 then begin
switch(contractprofit)
 begin   
  case 4500 to 10000 :
  if level1=1 then begin
  setdollartrailing(maxpositionprofit(0)*0.7);
  print(currentbar,"----","level1=1 and 4500 to 10000 ");
  end;
  case 10001 to 20000 :
  if level2=1 then begin
  setdollartrailing(maxpositionprofit(0)*0.55);
  print(currentbar,"----","level2=1 and 10001 to 20000 ");
  end;
  case 20001 to 30000 :
  if level3=1 then begin
  setdollartrailing(maxpositionprofit(0)*0.45);
  print(currentbar,"----","level3=1 and 20001 to 30000 ");
  end;
  case 30001 to 50000 :
  if level4=1 then begin
  setdollartrailing(maxpositionprofit(0)*0.35);
  print(currentbar,"----","level4=1 and 30001 to 50000  ");
  end;
  case 50001 to 70000 :
  if level5=1 then begin
  setdollartrailing(maxpositionprofit(0)*0.25);
  print(currentbar,"----","level5=1 and 50001 to 70000  ");
  end;
  case 70001 to 90000 :
  if level6=1 then begin
  setdollartrailing(maxpositionprofit(0)*0.20);
  print(currentbar,"----","level6=1 and 70001 to 90000   ");
  end;
  case 90001 to 140000 :
  if level7=1 then begin
  setdollartrailing(maxpositionprofit(0)*0.10);
  print(currentbar,"----","level7=1 and 90001 to 140000    ");
  end;
end;
        
end;

{if contractprofit>10000 then 
begin
 setdollartrailing(maxpositionprofit(0)*0.30);

end;
}

setstoploss((UpBand-DownBand)*300);
 if contractprofit<-6000 then
 begin
 
 setstoploss(8000);

end;
//setstoploss(10000);
//setstoploss(0.2*atr(14)[1]*300);
//setstoploss(0.12*atr(14)[1]*300);
//setstoploss(6000);



if marketposition=0 then
begin
countband=0;

end;

if time_s>145800 then
begin
sell 1 share next bar at market;
buytocover 1 share next bar at market;
countband=0;
counttrades=0;
buytrades=0;
selltrades=0;
end;


end;



如有需要,请加QQ:88652583 或微信:88652583 

扫一扫在手机打开当前页
  • 上一篇:代写同花顺公式 代写文华指标公式
  • 下一篇:CS109 代做、代写 java 设计编程
  • 无相关信息
    合肥生活资讯

    合肥图文信息
    新能源捕鱼一体电鱼竿好用吗
    新能源捕鱼一体电鱼竿好用吗
    海信罗马假日洗衣机亮相AWE  复古美学与现代科技完美结合
    海信罗马假日洗衣机亮相AWE 复古美学与现代
    合肥机场巴士4号线
    合肥机场巴士4号线
    合肥机场巴士3号线
    合肥机场巴士3号线
    合肥机场巴士2号线
    合肥机场巴士2号线
    合肥机场巴士1号线
    合肥机场巴士1号线
    合肥轨道交通线路图
    合肥轨道交通线路图
    合肥地铁5号线 运营时刻表
    合肥地铁5号线 运营时刻表
  • 币安app官网下载 短信验证码

    关于我们 | 打赏支持 | 广告服务 | 联系我们 | 网站地图 | 免责声明 | 帮助中心 | 友情链接 |

    Copyright © 2024 hfw.cc Inc. All Rights Reserved. 合肥网 版权所有
    ICP备06013414号-3 公安备 42010502001045