忍者ブログ

forex tester2のインディケーターを自作

fx(外国為替証拠金取引)のトレードの練習やルールの検証をForex Tester 2というソフトでしてみます。 Meta Trader4(MT4)のインディケーター(indicator)をForex Tester2用に移植できたらしてみます。

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。


T3.mq4(abysse版)

http://www.abysse.co.jp/mt4/indicators/T3.mq4
をForexTester2に移植してみました。

http://gaitameotoko.up.seesaa.net/image/T3.mq4
を移植したものは以下です。
http://forextester.o-oi.net/Entry/52/


こちらで販売中です。

MT4の表示です。


FT2の表示です。



販売中のインジケーター一覧はこちらです。

PR

コメント

こんにちは
いぜんはインディケーターを移植していただきありがとうございました! ずうずうしくもまたお願いしたく書き込んでおります。フィボナッチピボットです、よろしく御お願いします!

//+------------------------------------------------------------------+
//| FiboPiv_v1.mq4 |
//| Kalenzo |
//| bartlomiej.gorski@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Kalenzo"
#property link "bartlomiej.gorski@gmail.com"

#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
ObjectDelete("S1");
ObjectDelete("S2");
ObjectDelete("S3");
ObjectDelete("R1");
ObjectDelete("R2");
ObjectDelete("R3");
ObjectDelete("PIVIOT");
ObjectDelete("Support 1");
ObjectDelete("Support 2");
ObjectDelete("Support 3");
ObjectDelete("Piviot level");
ObjectDelete("Resistance 1");
ObjectDelete("Resistance 2");
ObjectDelete("Resistance 3");
Comment(" ");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{

//----
double rates[1][6],yesterday_close,yesterday_high,yesterday_low;
ArrayCopyRates(rates, Symbol(), PERIOD_D1);

if(DayOfWeek() == 1)
{
if(TimeDayOfWeek(iTime(Symbol(),PERIOD_D1,1)) == 5)
{
yesterday_close = rates[1][4];
yesterday_high = rates[1][3];
yesterday_low = rates[1][2];
}
else
{
for(int d = 5;d>=0;d--)
{
if(TimeDayOfWeek(iTime(Symbol(),PERIOD_D1,d)) == 5)
{
yesterday_close = rates[d][4];
yesterday_high = rates[d][3];
yesterday_low = rates[d][2];
}

}

}
}
else
{
yesterday_close = rates[1][4];
yesterday_high = rates[1][3];
yesterday_low = rates[1][2];
}


//---- Calculate Pivots

Comment("\nYesterday quotations:\nH ",yesterday_high,"\nL ",yesterday_low, "\nC ",yesterday_close);
double R = yesterday_high - yesterday_low;//range
double p = (yesterday_high + yesterday_low + yesterday_close)/3;// Standard Pivot
double r3 = p + (R * 1.000);
double r2 = p + (R * 0.618);
double r1 = p + (R * 0.382);
double s1 = p - (R * 0.382);
double s2 = p - (R * 0.618);
double s3 = p - (R * 1.000);

drawLine(r3,"R3", Lime,0);
drawLabel("Resistance 3",r3,Lime);
drawLine(r2,"R2", Green,0);
drawLabel("Resistance 2",r2,Green);
drawLine(r1,"R1", DarkGreen,0);
drawLabel("Resistance 1",r1,DarkGreen);

drawLine(p,"PIVIOT",Blue,1);
drawLabel("Piviot level",p,Blue);

drawLine(s1,"S1",Maroon,0);
drawLabel("Support 1",s1,Maroon);
drawLine(s2,"S2",Crimson,0);
drawLabel("Support 2",s2,Crimson);
drawLine(s3,"S3",Red,0);
drawLabel("Support 3",s3,Red);


//----
return(0);
}
//+------------------------------------------------------------------+
void drawLabel(string name,double lvl,color Color)
{
if(ObjectFind(name) != 0)
{
ObjectCreate(name, OBJ_TEXT, 0, Time[10], lvl);
ObjectSetText(name, name, 8, "Arial", EMPTY);
ObjectSet(name, OBJPROP_COLOR, Color);
}
else
{
ObjectMove(name, 0, Time[10], lvl);
}
}


void drawLine(double lvl,string name, color Col,int type)
{
if(ObjectFind(name) != 0)
{
ObjectCreate(name, OBJ_HLINE, 0, Time[0], lvl,Time[0],lvl);

if(type == 1)
ObjectSet(name, OBJPROP_STYLE, STYLE_SOLID);
else
ObjectSet(name, OBJPROP_STYLE, STYLE_DOT);

ObjectSet(name, OBJPROP_COLOR, Col);
ObjectSet(name,OBJPROP_WIDTH,1);

}
else
{
ObjectDelete(name);
ObjectCreate(name, OBJ_HLINE, 0, Time[0], lvl,Time[0],lvl);

if(type == 1)
ObjectSet(name, OBJPROP_STYLE, STYLE_SOLID);
else
ObjectSet(name, OBJPROP_STYLE, STYLE_DOT);

ObjectSet(name, OBJPROP_COLOR, Col);
ObjectSet(name,OBJPROP_WIDTH,1);

}
初めまして。
新しい手法を研究する際、いつも参考にさせていただいてます。
移植のお願いしたくコメントさせていただきます。
ADX-VT2です。

MT4標準のADXは特殊な計算式を用いられているので、他のチャートソフトのADXと描画がかなり異なります。
そこでVTと同じADXを描画してくれるADX-VT2をforextesterへ移植していただけたらうれしいです。
需要も結構あるように思います。

//+------------------------------------------------------------------+
//| ADX-VT2.mq4 |
//| Copyright (c) 2009, Fai Software Corp. |
//| http://d.hatena.ne.jp/fai_fx/ |
//+------------------------------------------------------------------+
#property copyright "Copyright (c) 2009, Fai Software Corp."
#property link "http://d.hatena.ne.jp/fai_fx/"
#property indicator_separate_window
#property indicator_buffers 8
#property indicator_color1 LightSeaGreen
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color7 Aqua
#property indicator_width7 2
#property indicator_color8 DeepPink
#property indicator_width1 2
#property indicator_width8 2
//---- input parameters
extern int ADXPeriod = 9;
extern bool CalcADXR = false;
extern bool ShowSignal = true;
extern double SignalDiff = 3.5;
//---- buffers
double ADXBuffer[];
double PlusDiBuffer[];
double MinusDiBuffer[];
double PlusDMBuffer[];
double MinusDMBuffer[];
double DifSumBuffer[];
double AlertUpBuffer[];
double ADXRBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
if(CalcADXR && ShowSignal){
Alert("Can't use CalcADXR with ShowSignal.");
CalcADXR = false;
}
//---- 3 additional buffers are used for counting.
IndicatorBuffers(8);
//---- indicator buffers
SetIndexBuffer(0,ADXBuffer);
SetIndexBuffer(1,PlusDiBuffer);
SetIndexBuffer(2,MinusDiBuffer);
SetIndexBuffer(3,PlusDMBuffer);
SetIndexBuffer(4,MinusDMBuffer);
SetIndexBuffer(5,DifSumBuffer);
SetIndexBuffer(6,AlertUpBuffer);
SetIndexBuffer(7,ADXRBuffer);
SetIndexStyle(3,DRAW_NONE);SetIndexStyle(4,DRAW_NONE);
SetIndexStyle(5,DRAW_NONE);SetIndexStyle(6,DRAW_NONE);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("ADX-VT("+ADXPeriod+")");
SetIndexLabel(0,"ADX");
SetIndexLabel(1,"+DI");
SetIndexLabel(2,"-DI");
SetIndexLabel(3,NULL);SetIndexLabel(4,NULL);
SetIndexLabel(5,NULL);
if(CalcADXR){
SetIndexLabel(7,"ADXR");
}else if(ShowSignal){
SetIndexLabel(6,"Signal");
SetIndexStyle(6,DRAW_ARROW);
SetIndexArrow(6,119);
SetIndexLabel(7,"Signal");
SetIndexStyle(7,DRAW_ARROW);
SetIndexArrow(7,119);
}else{
SetIndexLabel(7,NULL);
}

//----
SetIndexDrawBegin(0,ADXPeriod);
SetIndexDrawBegin(1,ADXPeriod);
SetIndexDrawBegin(2,ADXPeriod);
if(CalcADXR){
SetIndexDrawBegin(7,ADXPeriod*2);
}else if(ShowSignal){
SetIndexDrawBegin(7,ADXPeriod+1);
}
SetLevelStyle(EMPTY ,EMPTY ,Red);
SetLevelValue(0,20);


//----
return(0);
}
/*
TH:=if(Ref(C,-1) > H,Ref(C,-1),H);
TL:=if(Ref(C,-1) < L,Ref(C,-1),L);
TR:=TH-TL;

PlusDM:=if(H>Ref(H,-1) AND L>=Ref(L,-1), H-Ref(H,-1),
if(H >Ref(H,-1) AND L<Ref(L,-1) AND H-Ref(H,-1)> Ref(L,-1)-L, H-Ref(H,-1),
0));
PlusDI:=100*Wilders(PlusDM,Pr)/Wilders(TR,Pr);

MinusDM:=if(L<Ref(L,-1) AND H<=Ref(H,-1), Ref(L,-1)-L,
if(H>Ref(H,-1) AND L<Ref(L,-1) AND H-Ref(H,-1)<Ref(L,-1)-L, Ref(L,-1)-L,
0));
MinusDI:=100*Wilders(MinusDM,Pr)/Wilders(TR,Pr);

DIDif:=Abs(PlusDI-MinusDI);
DISum:=PlusDI+MinusDI;

ADXFinal:=100*Wilders(DIDif/DISum,Pr);
ADXRCustom:= (ADXFinal+Ref(ADXFinal,1-Pr))/2;

_ADX := if( cT=0,ADXFinal,ADXRCustom);
*/
//+------------------------------------------------------------------+
//| Average Directional Movement Index |
//+------------------------------------------------------------------+
int start()
{
int starti,i,counted_bars=IndicatorCounted();
double tmp;
//----
i=Bars-2;
PlusDMBuffer[i+1]=0;
MinusDMBuffer[i+1]=0;
if(counted_bars>=i) i=Bars-counted_bars-1;
starti=i;
//----
double TRBuffer[];
ArraySetAsSeries(TRBuffer,true);
ArrayResize(TRBuffer,Bars);
for(i=0;i<Bars;i++){
double TH = MathMax(Close[i+1],High[i]);
double TL = MathMin(Close[i+1],Low[i]);
TRBuffer[i] = TH-TL;
}
while(i>=0)
{
if(High[i]>High[i+1] && Low[i]>=Low[i+1]){
tmp = High[i]-High[i+1];
}else if(High[i]>High[i+1] && Low[i]<Low[i+1] && High[i]-High[i+1] > Low[i+1]-Low[i]){
tmp = High[i]-High[i+1];
}else{
tmp = 0;
}
PlusDMBuffer[i] = tmp;
if(Low[i]<Low[i+1] && High[i]<=High[i+1]){
tmp = Low[i+1]-Low[i];
}else if(High[i]>High[i+1] && Low[i]<Low[i+1] && High[i]-High[i+1] < Low[i+1]-Low[i]){
tmp = Low[i+1]-Low[i];
}else{
tmp = 0;
}
MinusDMBuffer[i] = tmp;
i--;
}
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
int limit=Bars-1-counted_bars;
//---- apply Wilder to +DI -DI
for(i=0; i<=limit; i++){
tmp = iMAOnArray(TRBuffer,Bars,ADXPeriod*2-1,0,MODE_EMA,i);
PlusDiBuffer[i]=100*iMAOnArray(PlusDMBuffer,Bars,ADXPeriod*2-1,0,MODE_EMA,i)/tmp;
MinusDiBuffer[i]=100*iMAOnArray(MinusDMBuffer,Bars,ADXPeriod*2-1,0,MODE_EMA,i)/tmp;
if(PlusDiBuffer[i]+MinusDiBuffer[i]>0)
DifSumBuffer[i]=MathAbs(PlusDiBuffer[i]-MinusDiBuffer[i])/(PlusDiBuffer[i]+MinusDiBuffer[i]);
}
for(i=0; i<=limit; i++){
ADXBuffer[i]=100*iMAOnArray(DifSumBuffer,Bars,ADXPeriod*2-1,0,MODE_EMA,i);
}

///////////////////////////////////
if(ShowSignal){
for(i=0; i<=limit; i++){
if(PlusDiBuffer[i]>PlusDiBuffer[i+1]+SignalDiff) AlertUpBuffer[i]=PlusDiBuffer[i];
if(MinusDiBuffer[i]>MinusDiBuffer[i+1]+SignalDiff) ADXRBuffer[i]=MinusDiBuffer[i];
}
}else if(CalcADXR){
for(i=0; i<=limit; i++) ADXRBuffer[i]=(ADXBuffer[i]+ADXBuffer[i-1+ADXPeriod])/2;
}
return(0);
}
//+------------------------------------------------------------------+

コメントを投稿する






Vodafone絵文字 i-mode絵文字 Ezweb絵文字(絵文字)


forex tester2 販売
Forex Tester 2の購入はこちらから。
カレンダー
03 2024/04 05
S M T W T F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
カテゴリー
フリーエリア



最新記事
最新CM
最新TB
RSS
ブログ内検索
アーカイブ
最古記事
プロフィール
HN:
fx練習生
年齢:
49
性別:
男性
誕生日:
1975/04/03
職業:
夢は専業トレーダー
趣味:
fx
自己紹介:
fxの専業トレーダーになって経済的自由と時間的自由を手に入れたいです。
自分で売買ルールを作成してテストして自信をもってリアルトレードしたいです。
P R