COCO研究院

 找回密碼
 註冊
搜索
查看: 3635|回復: 0

[其他程式語言] 使用了set指令的問題

[複製鏈接]
發表於 18-3-1 23:48 | 顯示全部樓層 |閱讀模式
本帖最後由 EEETRY55 於 18-3-1 23:56 編輯

使用了set指令的問題--出場後馬上又進場
有搜尋過阿政大的一個程式碼是開關控制因為是初學者,所以對程式碼的更改有些不瞭解的地方

阿政大的原程式碼是突破後買進,出場後,等價格再回到區間後,再突破才又買進。
那如果我的條件是
買進條件=> 10日線>20日線
賣出條件=> 10日線<20日線

停利後(20點),多單就不再進場,一直等到空單訊號出線才下單的話
應該要怎麼改程式碼?

謝謝

以下引用阿政大大程式碼
var:BB(99999),SS(0);var:MP(0),lastWay(0);
var:toDO(true);
if dayofweek(D)=1 and sessionlastbar then begin  
BB= highD(0);  
SS= lowD(0);
end;

MP= marketposition;

if MP[1]<>0 and MP=0 then begin  
toDo= false;  
if MP[1]>0 then lastWay=1;  
if MP[1]<0 then lastWay=-1;
end;


if C<BB and lastWay>0 then  
toDO= true;
if C>SS and lastWay<0 then
toDO= true;

if MP<=0 and toDO=true then
buy next bar BB stop;
if MP>=0 and toDO=true then  
sellshort next bar SS stop;

if MP<>0 then begin  setstoploss(50*bigpointvalue);  
setprofittarget(100*bigpointvalue);
end;





您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-5-1 08:36

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook