導航:首頁 > 源碼編譯 > atr超強黑馬源碼

atr超強黑馬源碼

發布時間:2022-11-14 08:19:54

❶ 通達信 區間震盪線 dpo指標源碼

通達信區間震盪線指標源碼是正確的。你不要亂動就可以使用。

❷ ATR分析的壓力單位是什麼

真實波動幅度均值(ATR)是交易系統設計者的一個不可缺少的工具,它稱得上是技術指標中的一匹真正的黑馬。每一位系統交易者都應當熟悉ATR及其具有的許多有用功能。其眾多應用包括:參數設置,入市,止損,獲利等,甚至是資金管理中的一個非常有價值的輔助工具。

❸ ATR20+20日振幅+通達信公式源碼

MTR:MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW));

MTR1:MAX(MAX((HIGH-LOW),ABS(REF(CLOSE,1)-HIGH)),ABS(REF(CLOSE,1)-LOW))/REF(C,1)*100;

日振幅%:ABS(H-L)/REF(C,1)*100;

ATR20數值:SMA(MTR,20,1);

ATR20幅度%:SMA(MTR1,20,1);

❹ 求決策樹源代碼。最好使用matlab實現。

function [Tree RulesMatrix]=DecisionTree(DataSet,AttributName)
%輸入為訓練集,為離散後的數字,如記錄1:1 1 3 2 1;
%前面為屬性列,最後一列為類標
if nargin<1
error('請輸入數據集');
else
if isstr(DataSet)
[DataSet AttributValue]=readdata2(DataSet);
else
AttributValue=[];
end
end
if nargin<2
AttributName=[];
end
Attributs=[1:size(DataSet,2)-1];
Tree=CreatTree(DataSet,Attributs);
disp([char(13) 'The Decision Tree:']);
showTree(Tree,0,0,1,AttributValue,AttributName);
Rules=getRule(Tree);
RulesMatrix=zeros(size(Rules,1),size(DataSet,2));
for i=1:size(Rules,1)
rule=cell2struct(Rules(i,1),{'str'});
rule=str2num([rule.str([1:(find(rule.str=='C')-1)]) rule.str((find(rule.str=='C')+1):length(rule.str))]);
for j=1:(length(rule)-1)/2
RulesMatrix(i,rule((j-1)*2+1))=rule(j*2);
end
RulesMatrix(i,size(DataSet,2))=rule(length(rule));
end
end
function Tree=CreatTree(DataSet,Attributs) %決策樹程序 輸入為:數據集,屬性名列表
%disp(Attributs);
[S ValRecords]=ComputEntropy(DataSet,0);
if(S==0) %當樣例全為一類時退出,返回葉子節點類標
for i=1:length(ValRecords)
if(length(ValRecords(i).matrix)==size(DataSet,1))
break;
end
end
Tree.Attribut=i;
Tree.Child=[];
return;
end
if(length(Attributs)==0) %當條件屬性個數為0時返回佔多數的類標
mostlabelnum=0;
mostlabel=0;
for i=1:length(ValRecords)
if(length(ValRecords(i).matrix)>mostlabelnum)
mostlabelnum=length(ValRecords(i).matrix);
mostlabel=i;
end
end
Tree.Attribut=mostlabel;
Tree.Child=[];
return;
end
for i=1:length(Attributs)
[Sa(i) ValRecord]=ComputEntropy(DataSet,i);
Gains(i)=S-Sa(i);
AtrributMatric(i).val=ValRecord;
end
[maxval maxindex]=max(Gains);
Tree.Attribut=Attributs(maxindex);
Attributs2=[Attributs(1:maxindex-1) Attributs(maxindex+1:length(Attributs))];
for j=1:length(AtrributMatric(maxindex).val)
DataSet2=[DataSet(AtrributMatric(maxindex).val(j).matrix',1:maxindex-1) DataSet(AtrributMatric(maxindex).val(j).matrix',maxindex+1:size(DataSet,2))];
if(size(DataSet2,1)==0)
mostlabelnum=0;
mostlabel=0;
for i=1:length(ValRecords)
if(length(ValRecords(i).matrix)>mostlabelnum)
mostlabelnum=length(ValRecords(i).matrix);
mostlabel=i;
end
end
Tree.Child(j).root.Attribut=mostlabel;
Tree.Child(j).root.Child=[];
else
Tree.Child(j).root=CreatTree(DataSet2,Attributs2);
end
end
end
function [Entropy RecordVal]=ComputEntropy(DataSet,attribut) %計算信息熵
if(attribut==0)
clnum=0;
for i=1:size(DataSet,1)
if(DataSet(i,size(DataSet,2))>clnum) %防止下標越界
classnum(DataSet(i,size(DataSet,2)))=0;
clnum=DataSet(i,size(DataSet,2));
RecordVal(DataSet(i,size(DataSet,2))).matrix=[];
end
classnum(DataSet(i,size(DataSet,2)))=classnum(DataSet(i,size(DataSet,2)))+1;
RecordVal(DataSet(i,size(DataSet,2))).matrix=[RecordVal(DataSet(i,size(DataSet,2))).matrix i];
end

Entropy=0;
for j=1:length(classnum)
P=classnum(j)/size(DataSet,1);
if(P~=0)
Entropy=Entropy+(-P)*log2(P);
end
end
else
valnum=0;
for i=1:size(DataSet,1)
if(DataSet(i,attribut)>valnum) %防止參數下標越界
clnum(DataSet(i,attribut))=0;
valnum=DataSet(i,attribut);
Valueexamnum(DataSet(i,attribut))=0;
RecordVal(DataSet(i,attribut)).matrix=[]; %將編號保留下來,以方便後面按值分割數據集
end
if(DataSet(i,size(DataSet,2))>clnum(DataSet(i,attribut))) %防止下標越界
Value(DataSet(i,attribut)).classnum(DataSet(i,size(DataSet,2)))=0;
clnum(DataSet(i,attribut))=DataSet(i,size(DataSet,2));
end
Value(DataSet(i,attribut)).classnum(DataSet(i,size(DataSet,2)))= Value(DataSet(i,attribut)).classnum(DataSet(i,size(DataSet,2)))+1;
Valueexamnum(DataSet(i,attribut))= Valueexamnum(DataSet(i,attribut))+1;
RecordVal(DataSet(i,attribut)).matrix=[RecordVal(DataSet(i,attribut)).matrix i];
end
Entropy=0;
for j=1:valnum
Entropys=0;
for k=1:length(Value(j).classnum)
P=Value(j).classnum(k)/Valueexamnum(j);
if(P~=0)
Entropys=Entropys+(-P)*log2(P);
end
end
Entropy=Entropy+(Valueexamnum(j)/size(DataSet,1))*Entropys;
end
end
end
function showTree(Tree,level,value,branch,AttributValue,AttributName)
blank=[];
for i=1:level-1
if(branch(i)==1)
blank=[blank ' |'];
else
blank=[blank ' '];
end
end
blank=[blank ' '];
if(level==0)
blank=[' (The Root):'];
else
if isempty(AttributValue)
blank=[blank '|_____' int2str(value) '______'];
else
blank=[blank '|_____' value '______'];
end
end
if(length(Tree.Child)~=0) %非葉子節點
if isempty(AttributName)
disp([blank 'Attribut ' int2str(Tree.Attribut)]);
else
disp([blank 'Attribut ' AttributName{Tree.Attribut}]);
end
if isempty(AttributValue)
for j=1:length(Tree.Child)-1
showTree(Tree.Child(j).root,level+1,j,[branch 1],AttributValue,AttributName);
end
showTree(Tree.Child(length(Tree.Child)).root,level+1,length(Tree.Child),[branch(1:length(branch)-1) 0 1],AttributValue,AttributName);
else
for j=1:length(Tree.Child)-1
showTree(Tree.Child(j).root,level+1,AttributValue{Tree.Attribut}{j},[branch 1],AttributValue,AttributName);
end
showTree(Tree.Child(length(Tree.Child)).root,level+1,AttributValue{Tree.Attribut}{length(Tree.Child)},[branch(1:length(branch)-1) 0 1],AttributValue,AttributName);
end
else
if isempty(AttributValue)
disp([blank 'leaf ' int2str(Tree.Attribut)]);
else
disp([blank 'leaf ' AttributValue{length(AttributValue)}{Tree.Attribut}]);
end
end
end
function Rules=getRule(Tree)
if(length(Tree.Child)~=0)
Rules={};
for i=1:length(Tree.Child)
content=getRule(Tree.Child(i).root);
%disp(content);
%disp([num2str(Tree.Attribut) ',' num2str(i) ',']);
for j=1:size(content,1)
rule=cell2struct(content(j,1),{'str'});
content(j,1)={[num2str(Tree.Attribut) ',' num2str(i) ',' rule.str]};
end
Rules=[Rules;content];
end
else
Rules={['C' num2str(Tree.Attribut)]};
end
end

❺ 麻煩改一下下面的副圖源碼,要導入大智慧里的,謝謝

{大智慧測試通過}
LC:=REF(CLOSE,1);
RS1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
BTR:=MAX(MAX((RS1-RS1),ABS(REF(RS1,1)-RS1)),ABS(REF(RS1,1)-RS1));
ATR:=MA(BTR,15);
RS:MA(RS1,6),COLOR0000FF,linethick0;
UP:RS+2.3*ATR,COLORAABB00,linethick0;
DN:RS-2.1*ATR,COLORBBAA00,linethick0;
主力:RS,LINETHICK2,COLORRED;
快線:RS1,COLORWHITE;
警戒:85,COLORBLUE;
安全:15,COLORBLUE;
PA2:=BARSLAST(CLOSE=HHV(CLOSE,150));
PA1:=BARSLAST(CLOSE=LLV(CLOSE,150));
DRAWICON(CROSS(PA1,PA2),RS,13);
DRAWICON(CROSS(PA2,PA1),RS,12);
DRAWICON(CROSS(RS1,RS),RS,12);
DRAWICON(CROSS(RS1,BTR),安全,12);
DRAWICON(CROSS(RS1,警戒),警戒,13);

閱讀全文

與atr超強黑馬源碼相關的資料

熱點內容
格式化硬碟dos命令 瀏覽:494
紅茶可以緩解壓力 瀏覽:997
騰訊雲怎麼弄七十多一年雲伺服器 瀏覽:717
java按鈕設置圖片 瀏覽:864
php數字分頁代碼 瀏覽:791
旅遊業程序員 瀏覽:395
區塊鏈第三代加密數字資產 瀏覽:525
把播放清單放在雲伺服器上 瀏覽:869
phpppt下載 瀏覽:300
1929pdf 瀏覽:366
編譯器是終端嗎 瀏覽:531
pdf改b4 瀏覽:380
命令通道 瀏覽:704
pdf去 瀏覽:543
嵌入式編譯器優化 瀏覽:127
不同品牌安卓一鍵換機用什麼軟體 瀏覽:957
二年下冊運演算法則 瀏覽:137
蘭溪兩級壓縮空壓機 瀏覽:137
網頁如何取回伺服器上的文件 瀏覽:96
linuxphp重啟命令行 瀏覽:575