COCO研究院

 找回密碼
 註冊
搜索
查看: 3161|回復: 1

加碼單重覆下單

[複製鏈接]
發表於 15-8-29 15:04 | 顯示全部樓層 |閱讀模式
大家好:

小弟近日在研究 進行加碼

但都會發現出現加碼單在罪後出場時 反覆操作

小弟是分三段加碼   

有時我前單與加碼單已經要出場

但在那同時 第二段加碼又出來

變成我明明是希望

試單=>加碼1=>加碼2 =>加碼3

一旦條件係出場條件時  所以單子應該是重來

我估計應該  我的加碼2與出場條件同時發生?



語法如下:



inputs:len(20);
vars: N(0),StopLoss(1),DV(0),BB(0),AccountBalance(0),DollarRisk(0),LTT(0),
Tracker(0),LastTrade(0);

input: InitialBalance(10000000),Leverage(3),Percentrisk(0.01);
/// Turtle len-Day Breakout Replica //////////////////////////////////////
if marketposition = 0 then begin
BB = 0;
N =  AvgTrueRange(len);

DV = N * BigPointValue;
AccountBalance = InitialBalance ;
DollarRisk = AccountBalance * Percentrisk;
ltt = IntPortion(DollarRisk/DV);
buy("b1") LTT shares next bar highest(h,len) or higher;
sellshort("s1") LTT shares next bar lowest(l,len) or lower;
end;

// LONG len
if marketposition = 1 then begin
BB = BB + 1;
if currentshares = LTT then begin
buy("b2-1") LTT shares next bar entryprice[0]+ (0.5*N) or higher;
buy ("b2-2")LTT shares next bar entryprice[0] + (1.0*N) or higher;
buy ("b2-3") LTT shares next bar entryprice[0](1.5*N) or higher;
end;
if currentshares = LTT * 2 then begin
buy ("b3-1") LTT shares next bar entryprice[0] + (1.0*N) or higher;
buy ("b3-2")LTT shares next bar entryprice[0] + (1.5*N) or higher;
end;
if currentshares = LTT * 3 then
buy ("b4-1") LTT shares next bar entryprice[0] + (1.5*N) or higher;
end;

sell ("out-S") next bar lowest(l,len*0.5) or lower;
// SHORT len
if marketposition = -1 then begin
BB = BB + 1;
if currentshares = LTT then begin
sellshort("s2-1") LTT shares next bar entryprice[0] - (0.5*N) or lower;
sellshort("s2-2") LTT shares next bar entryprice[0] - (1.0*N) or lower;
sellshort("s2-3") LTT shares next bar entryprice[0] - (1.5*N) or lower;
end;
if currentshares = LTT * 2 then begin
sellshort("s3-1") LTT shares next bar entryprice[0] - (1.0*N) or lower;
sellshort("s3-2") LTT shares next bar entryprice[0] - (1.5*N) or lower;
end;
if currentshares = LTT * 3 then
sellshort("s4-1") LTT shares next bar entryprice[0] - (1.5*N) or lower;
end;
buytocover ("out-B") next bar highest(h,len*0.5) or higher;
// STOPS


我研究過若把  第二段加碼拿掉 就比較不會出現這狀況
但想請教是否有在其他語法上進行調整
我研究過使用entryname(1)<>"出場名稱"   但似乎無用  所以想跟大家請教
語法上應如何調整為宜

圖如下



謝謝大家指點

出場又進場.png
 樓主| 發表於 15-8-29 18:06 | 顯示全部樓層
對不起

問了傻問題  

改成stop  限制下單數那調高 就解決了

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

本版積分規則

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

GMT+8, 24-4-20 06:32

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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