忍者ブログ
 
[53] [52] [51] [50] [49] [48] [47] [22] [26] [33] [39]

2024年04月28日

[PR]

×

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




※インジケーター等のファイルの保存方法
インジケーター(~.mq4)のリンクの上で右クリックでファイルを保存してください。

2010年06月13日

00-NR7_v100

00版のNR7(narrow renge of 7bars)のインジケーターです。
過去7日間でもっとも一日の値幅が小さかった日にサインが出ます。

00-NR7_v100.png




一日の値動きの値幅が1週間の内でもっとも小さくなるということは、相場がどっちに動こうか迷っている状態になっていると見ることが出来ます。
ですので、NR7のサインが出た翌日は大きく値が動く可能性がある為逆張りは手控える方が無難です。
逆に言えば動いた方向に順張りでトレードに入る準備をするといいでしょう。

値幅が小さくなり、エネルギーが溜まって大きく動く=収縮・拡散と考えると、精度を増す為のフィルターに同じような収縮・拡散を表示できるボリンジャーバンドを併用すると良いと思います。
ボリンジャーバンドも値動きが少なくなるとバンドの幅が狭まってきますので、バンドの幅が狭まっている時のNR7のサイン以外は強気なトレードをしないなどを色々使い方はあると思います。

パラメータの設定で計算日数を「7」以外にも設定できるのでNR10やNR20なども出来ます。
また、NR7の計算で参照する時間軸も、MTF対応の他のインジケーターの様に1時間足や5分足などのお好みの時間軸に変更出来ますので色々試して見てください。

00-NR7_v100.mq4

PR

※インジケーター等のファイルの保存方法
インジケーター(~.mq4)のリンクの上で右クリックでファイルを保存してください。

コメント

EA化
いつもブログ拝見しています。
突然のコメントすみません。

ダブルオー様作成のNR7,インディケーターを使ってEAを作ってみたのですが、コンパイルはされるものの、どうも正しいタイミングでポジション取りができていないようです。

このNR7インディケーターが、MTF対応させるところで入り子になっているためでしょうか?


参考までにEAは下記のとおりです。
お時間あるときにでもコメント頂戴できれば幸いです。



// Define Magic
#define MAGIC_1 201008291 //Stop Entry Order (Buy)
#define MAGIC_2 201008292 //Stop Entry Order (Sell)
#define MAGIC_3 201008293 //Close OVer
#define MAGIC_4 201008294 //HA Over

#define COMMENT "NR7"

// Define Lots
extern double Lots = 1.0;
extern int Slippage = 4;
extern double lStopLoss = 1000;
extern double sStopLoss = 1000;
extern double lTakeProfit = 1000;
extern double sTakeProfit = 1000;
extern double lTrailingStop = 10000;
extern double sTrailingStop = 10000;

//---- logic
extern bool Stop_Entry = false;
extern bool Close_Over = false;
extern bool HA_Over = false;
extern bool Test = true;


//---- input parameters
extern int timeFrame = 1440; // time frame
extern int period = 7; // period
extern bool bIntra = true; // intra bar
extern int nMaxBars = 0; // maximum number of bars to calculate, 0: no limit


extern color clOpenBuy = Blue;
extern color clCloseBuy = Aqua;
extern color clOpenSell = Red;
extern color clCloseSell = Violet;
extern color clModiBuy = Blue;
extern color clModiSell = Red;
extern string Name_Expert = "XXX_Ichimoku by Kobanzame";
extern bool UseSound = True;
extern string NameFileSound = "alert.wav";


// Main Function
int start()
{

double NR7_High = iCustom(NULL,0,"00-NR7_v100",timeFrame,period,bIntra,nMaxBars,2,1);
double NR7_Low = iCustom(NULL,0,"00-NR7_v100",timeFrame,period,bIntra,nMaxBars,3,1);
double NR7_High_Prev = iCustom(NULL,0,"00-NR7_v100",timeFrame,period,bIntra,nMaxBars,2,2);
double NR7_Low_Prev = iCustom(NULL,0,"00-NR7_v100",timeFrame,period,bIntra,nMaxBars,3,2);
bool New_Phase = False;

//==TEST======================================================================================================================================
if(Test){
if(NR7_High != NR7_High_Prev){New_Phase = True;}
if(New_Phase){
// Buy Entry
if(!ExistPositions(MAGIC_4)){
if( Close[1] > NR7_High
&& Open[1] < NR7_High ) {
OpenBuy(MAGIC_4,UseSound,Slippage,clOpenBuy,NameFileSound,Lots,lStopLoss,lTakeProfit,Name_Expert);
New_Phase = false;
}
}

// Sell Entry
if(!ExistPositions(MAGIC_4)){
if( Close[1] < NR7_Low
&& Open[1] > NR7_Low ){
OpenSell(MAGIC_4,UseSound,Slippage,clOpenSell,NameFileSound,Lots,sStopLoss,sTakeProfit,Name_Expert);
New_Phase = false;
}
}
}
}

return(0);
}

bool ExistPositions(int MAGIC) {
for (int i=0; i<OrdersTotal(); i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) {
return(True);
}
}
}
return(false);
}

void OpenBuy(int MAGIC,bool UseSound,int Slippage,int clOpenBuy,string NameFileSound,double Lots,double lStopLoss,double lTakeProfit,string Name_Expert) {
double ldLot, ldStop, ldTake;
string lsComm;
ldLot = GetSizeLot(Lots);
ldStop = GetStopLossBuy(lStopLoss);
ldTake = GetTakeProfitBuy(lTakeProfit);
lsComm = GetCommentForOrder(Name_Expert);
OrderSend(Symbol(),OP_BUY,ldLot,Ask,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenBuy);
if (UseSound) PlaySound(NameFileSound);
}
void OpenSell(int MAGIC,bool UseSound,int Slippage,int clOpenSell,string NameFileSound,double Lots,double sStopLoss,double sTakeProfit,string Name_Expert) {
double ldLot, ldStop, ldTake;
string lsComm;

ldLot = GetSizeLot(Lots);
ldStop = GetStopLossSell(sStopLoss);
ldTake = GetTakeProfitSell(sTakeProfit);
lsComm = GetCommentForOrder(Name_Expert);
OrderSend(Symbol(),OP_SELL,ldLot,Bid,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenSell);
if (UseSound) PlaySound(NameFileSound);
}

string GetCommentForOrder(string Name_Expert) { return(Name_Expert); }
double GetSizeLot(double Lots) { return(Lots); }
double GetStopLossBuy(double lStopLoss) { return (Bid-lStopLoss*Point);}
double GetStopLossSell(double sStopLoss) { return(Ask+sStopLoss*Point); }
double GetTakeProfitBuy(double lTakeProfit) { return(Ask+lTakeProfit*Point); }
double GetTakeProfitSell(double sTakeProfit) { return(Bid-sTakeProfit*Point); }

Re:EA化
コバンザメさんこんにちは。
長期放置申し訳ないです。
現状00氏も多忙な状態が続いている様で、しかもワタクシEAの知識に乏しいのでおこたえしようが有りません・・・
解決済みかもしれませんが2ちゃんのメタトレスレなどで質問されると親切な方が居るかもしれません・・・
お役に立てず申し訳ないです。
00氏が復活したら聞いてみますね。
2010/10/08 16:33||管理人
EA化
いつもブログ拝見しています。
突然のコメントすみません。

ダブルオー様作成のNR7,インディケーターを使ってEAを作ってみたのですが、コンパイルはされるものの、どうも正しいタイミングでポジション取りができていないようです。

このNR7インディケーターが、MTF対応させるところで入り子になっているためでしょうか?


参考までにEAは下記のとおりです。
お時間あるときにでもコメント頂戴できれば幸いです。



// Define Magic
#define MAGIC_1 201008291 //Stop Entry Order (Buy)
#define MAGIC_2 201008292 //Stop Entry Order (Sell)
#define MAGIC_3 201008293 //Close OVer
#define MAGIC_4 201008294 //HA Over

#define COMMENT "NR7"

// Define Lots
extern double Lots = 1.0;
extern int Slippage = 4;
extern double lStopLoss = 1000;
extern double sStopLoss = 1000;
extern double lTakeProfit = 1000;
extern double sTakeProfit = 1000;
extern double lTrailingStop = 10000;
extern double sTrailingStop = 10000;

//---- logic
extern bool Stop_Entry = false;
extern bool Close_Over = false;
extern bool HA_Over = false;
extern bool Test = true;


//---- input parameters
extern int timeFrame = 1440; // time frame
extern int period = 7; // period
extern bool bIntra = true; // intra bar
extern int nMaxBars = 0; // maximum number of bars to calculate, 0: no limit


extern color clOpenBuy = Blue;
extern color clCloseBuy = Aqua;
extern color clOpenSell = Red;
extern color clCloseSell = Violet;
extern color clModiBuy = Blue;
extern color clModiSell = Red;
extern string Name_Expert = "XXX_Ichimoku by Kobanzame";
extern bool UseSound = True;
extern string NameFileSound = "alert.wav";


// Main Function
int start()
{

double NR7_High = iCustom(NULL,0,"00-NR7_v100",timeFrame,period,bIntra,nMaxBars,2,1);
double NR7_Low = iCustom(NULL,0,"00-NR7_v100",timeFrame,period,bIntra,nMaxBars,3,1);
double NR7_High_Prev = iCustom(NULL,0,"00-NR7_v100",timeFrame,period,bIntra,nMaxBars,2,2);
double NR7_Low_Prev = iCustom(NULL,0,"00-NR7_v100",timeFrame,period,bIntra,nMaxBars,3,2);
bool New_Phase = False;

//==TEST======================================================================================================================================
if(Test){
if(NR7_High != NR7_High_Prev){New_Phase = True;}
if(New_Phase){
// Buy Entry
if(!ExistPositions(MAGIC_4)){
if( Close[1] > NR7_High
&& Open[1] < NR7_High ) {
OpenBuy(MAGIC_4,UseSound,Slippage,clOpenBuy,NameFileSound,Lots,lStopLoss,lTakeProfit,Name_Expert);
New_Phase = false;
}
}

// Sell Entry
if(!ExistPositions(MAGIC_4)){
if( Close[1] < NR7_Low
&& Open[1] > NR7_Low ){
OpenSell(MAGIC_4,UseSound,Slippage,clOpenSell,NameFileSound,Lots,sStopLoss,sTakeProfit,Name_Expert);
New_Phase = false;
}
}
}
}

return(0);
}

bool ExistPositions(int MAGIC) {
for (int i=0; i<OrdersTotal(); i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) {
return(True);
}
}
}
return(false);
}

void OpenBuy(int MAGIC,bool UseSound,int Slippage,int clOpenBuy,string NameFileSound,double Lots,double lStopLoss,double lTakeProfit,string Name_Expert) {
double ldLot, ldStop, ldTake;
string lsComm;
ldLot = GetSizeLot(Lots);
ldStop = GetStopLossBuy(lStopLoss);
ldTake = GetTakeProfitBuy(lTakeProfit);
lsComm = GetCommentForOrder(Name_Expert);
OrderSend(Symbol(),OP_BUY,ldLot,Ask,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenBuy);
if (UseSound) PlaySound(NameFileSound);
}
void OpenSell(int MAGIC,bool UseSound,int Slippage,int clOpenSell,string NameFileSound,double Lots,double sStopLoss,double sTakeProfit,string Name_Expert) {
double ldLot, ldStop, ldTake;
string lsComm;

ldLot = GetSizeLot(Lots);
ldStop = GetStopLossSell(sStopLoss);
ldTake = GetTakeProfitSell(sTakeProfit);
lsComm = GetCommentForOrder(Name_Expert);
OrderSend(Symbol(),OP_SELL,ldLot,Bid,Slippage,ldStop,ldTake,lsComm,MAGIC,0,clOpenSell);
if (UseSound) PlaySound(NameFileSound);
}

string GetCommentForOrder(string Name_Expert) { return(Name_Expert); }
double GetSizeLot(double Lots) { return(Lots); }
double GetStopLossBuy(double lStopLoss) { return (Bid-lStopLoss*Point);}
double GetStopLossSell(double sStopLoss) { return(Ask+sStopLoss*Point); }
double GetTakeProfitBuy(double lTakeProfit) { return(Ask+lTakeProfit*Point); }
double GetTakeProfitSell(double sTakeProfit) { return(Bid-sTakeProfit*Point); }

コメントする

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