COCO研究院

 找回密碼
 註冊
搜索
查看: 3503|回復: 7

在以下的停損條件下反手做多要怎麼處理呢

[複製鏈接]
發表於 12-4-4 15:21 | 顯示全部樓層 |閱讀模式
var:bb(0);

if d<>d[1] then begin
  if close>open then buy this bar on close ;
  bb=high+10*MinMove/pricescale;
end;
if marketposition<0 then buytocover next bar bb stop;

小弟想要在停損的時候直接反手做多
就是本來一個空單
直接加兩個多單新倉變成一個多單部位
請問要怎麼處理呢
發表於 12-4-4 19:29 | 顯示全部樓層
本帖最後由 無無明 於 12-4-4 19:38 編輯

var:buystop(0),sellstop(0);
if marketposition=0 then begin  
      buystop=0;  sellstop=0;
end;
if d<>d[1] and marketposition=0  then begin
    if close>open then begin        
       buy 1 contracts this bar on close ;
       sellstop=low - 10 points;
       buystop=0;
   end;
   if close<open then begin
       SellShort 1 contracts  this bar on close ;
       buystop=hogh + 10 points;
       sellstop=0;
   end;
end;
if marketposition>0 and sellstop>0 then begin
     sell 1 contracts next bar at sellstop stop;
     rev=-1;
end;
if marketposition<0 and buystop>0 then begin
     buytocover 1 contracts next bar at buystop stop;
     rev=1;
end;

if  d=d[1] and marketposition=0  then begin
    if rev=1 then begin        
       buy 1 contracts this bar on close ;
       sellstop=low - 10 points;
       buystop=0;
   end;
   if rev=-1  then begin
       SellShort 1 contracts  this bar on close ;
       buystop=hogh + 10 points;
       sellstop=0;
   end;
end;



補充內容 (12-4-5 08:09):
var rev(0);
發表於 12-4-4 19:39 | 顯示全部樓層
無大是 MC 專家
請多多向他學習
發表於 12-4-4 19:42 | 顯示全部樓層
本帖最後由 無無明 於 12-4-4 19:44 編輯

還缺獲利的邏輯
獲利的邏輯 完成後,要 歸零 rev

建議 把這種當成 練習程式
不要當真

還有許多邏輯漏洞。
 樓主| 發表於 12-4-4 21:19 | 顯示全部樓層
抱歉再請教一下
rev=1跟rev=-1那行有錯誤無法編譯過去
問題是出在哪邊呢
還有歸零rev是指????
發表於 12-4-20 09:08 | 顯示全部樓層
感謝無大 無私分享!!
發表於 12-4-29 23:46 | 顯示全部樓層
thanks very much for sharing your wisdom
發表於 12-6-29 01:20 | 顯示全部樓層
在討論區內看到好多無大分享的想法,
受益良多啊

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

本版積分規則

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

GMT+8, 24-5-7 08:34

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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