casper0425 發表於 11-7-11 14:12

請教大大如何限制進場的條件

以當沖來說,過8:45後,如果以均線交叉進場,我想限定第一次的交叉不進場,以第二次的交叉再進場,我該如何以程式表達。

If time >= 0845 and time <= 1300 and marketposition = 0 then begin
If close cross over value1 then buy next bar at open;
If close cross under value1 then sellshort next bar at open;
end;

要加那些程式碼,煩請大大解惑。

mewmi 發表於 11-7-11 14:48

以當沖來說,過8:45後,如果以均線交叉進場,我想限定第一次的交叉不進場,以第二次的交叉再進場,我該如何 ...
casper0425 發表於 11-7-11 02:12 PM http://coco-in.net/images/common/back.gif

var:
    First_Cross(True);

if date <> date then First_Cross = True;

If time >= 0845 and time <= 1300 and marketposition = 0 then begin
If close cross over value1 then
    if First_Cross then First_Cross = False
    else buy next bar at open;
If close cross under value1 then
    if First_Cross then First_Cross = False
    else sellshort next bar at open;
end;

{:4_196:}

milumilu 發表於 11-7-11 15:17

回復 3# mewmi


    按讚按讚 ........{:4_87:}

casper0425 發表於 11-7-11 15:26

感謝m大的解說,感恩~~~~

mewmi 發表於 11-7-11 15:54

不客氣.. 希望有幫助.. {:4_162:}

沒有完美 發表於 11-7-11 19:48

回復 3# mewmi


太利害了.....{:5_260:}

複製後列印下來...

晚上失眠拿來拜讀肯定有效....

mewmi 發表於 11-7-11 20:41

回復 7# 沒有完美

這個若無效的話.. 這裡還有一個藥效更強的.. http://coco-in.net/thread-11959-1-1.html{:4_163:}

沒有完美 發表於 11-7-12 13:53

回復 8# mewmi


差點忘了你有分享這個好工具...{:5_260:}
最近有在研究媽踢洽特..
恰好可以拿來玩玩...

kilroy 發表於 11-7-12 13:54

mewmi 大大的MC很厲害的 {:4_113:}

mewmi 發表於 11-7-12 14:22

喔.. 我不算厲害啦.. 我只是恰好可以把腦袋想的東西寫出來而已.. {:4_186:}

nvibia 發表於 11-7-17 21:42

mewmi 大大,要給你一個大大的讚

tamasdo 發表於 11-7-18 22:45

讚喔{:5_259:}{:5_259:}
頁: [1]
查看完整版本: 請教大大如何限制進場的條件