inputs:value1(buy), value2(l[1]); vars:value1,value2 value1=buy or sellshort; value2=l[1] or h[1];
if o>value2 then value1 next bar at value2 stop; end; setexitonclose;
1.我想把buy和sell作成參數
2.我想value2的高低點作成參數
拿來跑2*2最佳化 請問這語法哪裡錯了,感謝
end 前的 begin 在那裡?
value1 及 value2 是數字變數不是邏輯變數
買賣指令不能變數化 .... 錯誤寫不完
程式碼完全不合語法
直接改寫如下,自已修正大於小於處
inputs: pMode(1), pPriceMode(1);
if pPriceMode=1 then begin value1 = L[1]; condition1 = O<L[1]; end else begin value1 = H[1]; condition1 = O>H[1]; end;
if pMode = 1 then begin if condition1 then buy next bar value1 stop; end else begin if condition1 then buy next bar value1 stop; end;
setexitonclose;
thx for ur answer!!!!
make a big help to me
1,請問您的意思,邏輯變數是用else區分h[1]和l[1]的?
2.可以請教參數中的1,1代表昨天這樣嗎?
1. 你可能要先弄懂 邏輯變數的義意,這是程式的基礎
2. [1] 表示的是前一跟K棒,不一定是昨天,在日線而言你是對的,在分線或其他線來說,你是錯的
謝謝 我好好研究基礎
thx
編輯不出來
他說問題出在離開那裏咧
我發現是少begin
但begin不是用在2行以上的程式碼嗎
語法裡面的第二行是?
有用 end;
就要有 BUGIN
若不加 BEGIN 就把 END 刪掉