COCO研究院

 找回密碼
 註冊
搜索
查看: 25657|回復: 23

Tradestation是否走完整條Bar, 才會生成買賣條件及下單功能?

[複製鏈接]
發表於 10-12-20 10:44 | 顯示全部樓層 |閱讀模式
聽聞Tradestation是走完整條Bar(假設是日線圖), 才會生成買賣條件及下單功能, 請問是否真的? 是否不能在日線中, 當條件生成便以當時即市價發出下單指令?
另Multicharts是否跟Tradestation一樣, 只可在收市前出盤下單或下一條Bar才可下單?  :D
發表於 10-12-20 11:36 | 顯示全部樓層
MC 不需要 當跟棒 走完 才進行下單指令
一出現 合乎條件 就可以 送出 信號

問題在於 技巧的安排 以及 一個 宣告指令
[IntrabarOrderGeneration = true];
 樓主| 發表於 10-12-20 12:24 | 顯示全部樓層
MC 不需要 當跟棒 走完 才進行下單指令
一出現 合乎條件 就可以 送出 信號

問題在於 技巧的安排 以及 一個 ...
trading144 發表於 10-12-20 11:36 AM


謝謝你!  找找試試看!  :D
發表於 10-12-20 15:50 | 顯示全部樓層
能不能請大大用各範例來參考看看呢
謝謝
發表於 10-12-20 21:20 | 顯示全部樓層
本帖最後由 trading144 於 10-12-20 09:24 PM 編輯

[IntrabarOrderGeneration = true];//宣告 當跟棒 呈現信號

//建立新倉的條件區塊
if 你的 多方條件=true  then begin
   buy 1 contracts this bar on close;
(或    buy 1 contracts next bar at market;)
   isLong=1;//自設 多空的控制變數
   isShort=0;
   pp=close;//pp 自設變數 等於 建倉的成本
end;

if 你的 空方條件=true  then begin
   SellShort 1 contracts this bar on close;
(或    SellShort 1 contracts next bar at market;)
   isLong=0;//自設 多空的控制變數
    isShort=1;
   pp=close;
end;
// 平倉 的 邏輯檢定區塊
if isLong = true or marketposition = 1 then begin
   使用 你的 平倉條件
end;
if isShort = true or marketposition = -1 then begin
   使用 你的 平倉條件
end;
發表於 10-12-20 23:05 | 顯示全部樓層
太厲害了
謝謝大大
我趕緊來試試看
發表於 10-12-20 23:57 | 顯示全部樓層
回復 5# trading144


   我一直感覺這指令是directive型的 .也就是把某一段的執行碼 的環境設定打開:
所以我想應也可 :

[IntrabarOrderGeneration = false];//

if condition1 then   entry order here ;

[IntrabarOrderGeneration = true];//

if condition2 then close order here ;
if condition3 then stoploss order here ;

待會兒試試 .
發表於 10-12-21 00:19 | 顯示全部樓層
本帖最後由 TrendRover 於 10-12-21 12:20 AM 編輯

不行.
[IntrabarOrderGeneration = false]
inputs:
        TLRef( 1 ) ,TLRef2(2) ;                                                                     
                          

variables:
        var0( TL_GetBeginDate( TLRef ) ),
        var1( TL_GetBeginTime( TLRef ) ),
        var2( false ) ;

var2 = ( Date = var0 and ( BarType = 2 or ( BarType = 1 and Time >= var1 ) ) )
or Date > var0 ;

condition1 = var2 and High < TL_GetValue( TLRef, Date, Time ) ;
if condition1 then
        Buy ("LE")  next bar at TL_GetValue( TLRef, Date next bar, Time next bar ) stop ;

[IntrabarOrderGeneration = true]

condition2= var2 and high > TL_Getvalue(TLRef2,Date,Time) ;

if condition2 then
     sell ("LX")  from entry ("LE")  next bar at market ;


compiled 過了 .
但執行時抱怨:
   intrabar 和 next bar 不可共用於同策略 .
發表於 10-12-21 08:01 | 顯示全部樓層
[IntrabarOrderGeneration = true]  不可以 改來改去
this bar  跟  next bar  關鍵 不是 邏輯條件
而是 [1]   [2]  ....等等
關鍵的 技巧,點到為止
發表於 10-12-21 08:02 | 顯示全部樓層
更正一下:
if isLong = 1 or marketposition = 1 then begin
   使用 你的 平倉條件
end;
if isShort = 1 or marketposition = -1 then begin
   使用 你的 平倉條件
end;
發表於 10-12-21 08:09 | 顯示全部樓層
還有 不要 使用  XXX  cross over(或under)  xxxx 這個語法
會產生 重複信號

自定義函數 去 控制:
函數 名稱 Crossed
if xxxxx  then currentdirection=1;
if xxxxx  then currentdirection=2;
if currentdirection<>lastdirection then begin
   lastdirection=currentdirection;
   Crossed=lastdirection;
else
begin
   Crossed=0;
end;
這樣 確保 信號出現一次
發表於 10-12-21 13:51 | 顯示全部樓層
發表於 10-12-21 14:47 | 顯示全部樓層
你還是 沒搞懂,我的樣版 關鍵 在於哪裡
圖上顯示 單一信號 進單 及 出場
中間那裡 還有一筆,平倉 反向
test.gif
發表於 10-12-22 10:52 | 顯示全部樓層
本帖最後由 TrendRover 於 10-12-22 10:59 AM 編輯

Trading大真好心,謝謝了 .
我貼multichart 的 討論文是提醒沒 模倪帳戶的台友要小心 :
   intrabarorder 弄得不好會敗光帳戶 :

    話說我昨天的 紙帳戶策略測試 :
    STW摩台指期 multichart 圖上 一根 stw-error-data.gif
334.X的衝天炮(實際上是315.8)
從 InteractiveBroker  TWS  圖上看 ,什麼也沒有 .這樣的錯誤 data 卻把entry exit 亂下一通.
    不知trading大大對 用兩個 datasource 作check 的運算有沒有範例可參考 .
發表於 10-12-22 12:00 | 顯示全部樓層
本帖最後由 trading144 於 10-12-22 12:01 PM 編輯

國外 資訊源 針對 亞洲地區 的 數據,多有問題

我 香港恆生 使用 美國一家公司的數據 導入,有多會有 怪異的 低或 高點 數據出現。

所以,只有 直接透過 國內軟體,自行收集 TICK 數據,慢慢累積

PS:如果 程式流程,依照我提供的模版去規劃,不會發生 當根K棒 進場 又 出場。
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-4-26 09:22

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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