到奇狐勝券首頁 奇狐社區論壇 購買奇狐勝券 試用奇狐勝券
 
論壇首頁 你可以在這裡編輯你的資料,查看短訊,訂閱主題和論壇參數等等 免費會員註冊 會員列表 論壇幫助 論壇日曆 論壇搜索 加入我的最愛 登出論壇  
奇狐社區論壇 : Powered by vBulletin version 2.3.0 奇狐社區論壇 > 指標公式 > 問題交流 > Heikin Ashi 求助
  上一主題   下一主題
作者
主題 發表新主題    回覆主題
lin123
資深會員

註冊日期: Apr 2004
來  自:
文章數量: 103

Heikin Ashi 求助

C++ 程式語言

請教如何改寫成奇狐可用?

BaseDataIn 0 is open, 1 is high, 2 is low and 3 is close:

int pos, updn=0;
float jO=0, jH, jL, jC=0, jHm1, jLm1;
sg.DataStartIndex=15;

jL=sg.BaseDataIn[4][0]; jO=jL; jC=jL; jH=jL;
for (pos=5; pos < sg.ArraySize; pos++)
{
jHm1=jH;
jLm1=jL;
jO=(jO+jC)/2;
jC=(sg.BaseDataIn[0][pos]+sg.BaseDataIn[1][pos]+sg.BaseDataIn[2][pos]+sg.BaseDataIn[3][pos])/4;

if(jO>sg.BaseDataIn[1][pos] && jO>jC) jH=jO; else if(jC>sg.BaseDataIn[1][pos]) jH=jC; else jH=sg.BaseDataIn[1][pos];
if(jO<sg.BaseDataIn[2][pos] && jO<jC) jL=jO; else if(jC<sg.BaseDataIn[2][pos]) jL=jC; else jL=sg.BaseDataIn[2][pos];

if(jH>jHm1 && jL>=jLm1) {updn=1;} else
if(jL<jLm1 && jH<=jHm1) {updn=-1;};

if((sg.Input[2].FloatValue!=1 && sg.Input[2].FloatValue!=-1) || (sg.Input[2].FloatValue==1 && updn==1) || (sg.Input[2].FloatValue==-1 && updn==-1))

{
sg.Subgraph[0].Data[pos]=jO;
sg.Subgraph[1].Data[pos]=jH;
sg.Subgraph[2].Data[pos]=jL;
sg.Subgraph[3].Data[pos]=jC;
};

向版主報告此篇 | 查IP位址
Old Post 2007-05-09 19:37
lin123 現在離線 點選這裡查看 lin123 的個人資料 點選這裡給 lin123 傳送一條短訊 查找更多關於 lin123 的文章 增加 lin123 至你的好友列表 編輯/刪除訊息 引用回覆
cgjj
總版主

註冊日期: Oct 2003
來  自:
文章數量: 18091

回覆: Heikin Ashi 求助

請勿給其他軟體程式原碼要我們轉換
請說明其內容的計算方法和原理
這樣會好處理些

向版主報告此篇 | 查IP位址
Old Post 2007-05-09 20:03
cgjj 現在離線 點選這裡查看 cgjj 的個人資料 點選這裡給 cgjj 傳送一條短訊 查找更多關於 cgjj 的文章 增加 cgjj 至你的好友列表 編輯/刪除訊息 引用回覆
lin123
資深會員

註冊日期: Apr 2004
來  自:
文章數量: 103

裁縫線

版主 它是裁縫線 也

向版主報告此篇 | 查IP位址
Old Post 2007-05-09 20:46
lin123 現在離線 點選這裡查看 lin123 的個人資料 點選這裡給 lin123 傳送一條短訊 查找更多關於 lin123 的文章 增加 lin123 至你的好友列表 編輯/刪除訊息 引用回覆
king
版主

註冊日期: Jan 2004
來  自:
文章數量: 2783

ClosePrice:=if(BarsCount(Close)=1 , (Open+High+Low+Close)/4 , Close);
OpenPrice:=if(BarsCount(Close)=1 , (Open+Close)/2 , Sma(ref(ClosePrice,1),2,1));
HighPrice:=High;
LowPrice:=Low;
StickLine( OpenPrice<ClosePrice , HighPrice , LowPrice , 0.1 , 0 ) , ColorRed ;
StickLine( OpenPrice<ClosePrice , ClosePrice , OpenPrice, 7 , 1 ) , ColorRed ;
StickLine( OpenPrice>ClosePrice , HighPrice , LowPrice , 0.1 , 0 ) , ColorCyan ;
StickLine( OpenPrice>ClosePrice , ClosePrice , OpenPrice , 7 , 0 ) , ColorCyan ;
StickLine( OpenPrice=ClosePrice and ClosePrice>=Ref( ClosePrice , 1 ) , HighPrice , LowPrice , 0.1 , 0 ) , ColorRed ;
StickLine( OpenPrice=ClosePrice and ClosePrice>=Ref( ClosePrice , 1 ) , ClosePrice , OpenPrice , 7 , 0 ) , ColorRed ;
StickLine( OpenPrice=ClosePrice and ClosePrice<Ref( ClosePrice , 1 ) , HighPrice , LowPrice , 0.1 , 0 ) , ColorCyan ;
StickLine( OpenPrice=ClosePrice and ClosePrice<Ref( ClosePrice , 1 ) , ClosePrice , OpenPrice , 7 , 0 ) , ColorCyan ;
StickLine( OpenPrice=ClosePrice and Barscount(Close) , HighPrice, LowPrice, 0.1, 0 ) , ColorRed ;
StickLine( OpenPrice=ClosePrice and Barscount(Close) , OpenPrice , ClosePrice , 7 , 0 ) , ColorRed ;

__________________
E-Trader World 交易世界
Plurk
Facebook
Twitter
(EQ:情緒智商) & (HD:習慣領域)才是主導成功交易的重要關鍵。
「存於一個人自身的真相非常簡單,然而人們卻總是追求深奧的真理。」,金融交易亦是如此。

向版主報告此篇 | 查IP位址
Old Post 2007-05-10 15:41
king 現在離線 點選這裡查看 king 的個人資料 點選這裡給 king 傳送一條短訊 進入 king 的首頁! 查找更多關於 king 的文章 增加 king 至你的好友列表 編輯/刪除訊息 引用回覆
lin123
資深會員

註冊日期: Apr 2004
來  自:
文章數量: 103

King,

Thank you very much!!

* 若不想從原始 第一根 起算 ;
想自動 從 前1高 或 前1低 ; 為第1根運算處理
如何寫控制語法

謝謝!!

向版主報告此篇 | 查IP位址
Old Post 2007-05-10 18:38
lin123 現在離線 點選這裡查看 lin123 的個人資料 點選這裡給 lin123 傳送一條短訊 查找更多關於 lin123 的文章 增加 lin123 至你的好友列表 編輯/刪除訊息 引用回覆
全部時間均為台灣時間, 現在時間為02:59 發表新主題    回覆主題
  上一主題   下一主題
顯示可列印版本 | 訂閱此主題

論壇跳轉:
主題評分:

論壇規定:
你不可以發表新主題
你不可以回覆文章
你不可以上傳附件
你不可以編輯自己的文章
HTML語法禁止
vB 語法核准
表情符號核准
貼圖語法[IMG]核准
 

本站所有內容未經作者授權禁止轉貼節錄, 發表言論僅供參考勿作為投資決策依據。瀏覽本站請使用 IE 5.5 以上版本, 最佳瀏覽解析度 1024 x 768 全彩。

Powered by: vBulletin Version 2.3.0 - Copyright©2000-, Jelsoft Enterprises Limited.

簡愛洋行 製作 Copyright 2003-. All Rights Reserved.  聯絡我們