コーディングのヘルプ - ページ 173

 

こんにちは、コーダーの皆さん。

このバージョンはm1、m5、m15のチャートをチェックします。うまくいくのですが、アラートがすべてのティックで 表示され、条件が満たされた時間枠の中で一度だけ表示されないという問題があります。

構文の問題だと思うのですが・・・。

ありがとうございました。

ファイル:
test.mq4  3 kb
 

こんにちは。

私はエラーを見つけることができないので、再度質問させてください。

どなたか、私の失敗をご覧になりましたか?

これは、インジケータのコードです。

#property indicator_chart_window

#property indicator_buffers 5

double WidestChannel_high[];

double InsideChannel_high[];

double StandardDeviation[];

double InsideChannel_low[];

double WidestChannel_low[];

extern int STD.Rgres.period=0; /*default 0 means the channel will use the open

time from "x" bars back on which ever time period

the indicator is attached to. one can change to 1,5,

15,30,60...etc to "lock" the start time to a specific

period, and then view the "locked" channels on a different time period...*/

extern int STD.Rgres.length=56; // bars back regression begins

extern double STD.Rgres.width=1.618;// widest channel

extern double STD.width=0.618; // inside channel

int init()

{

SetIndexBuffer(0,WidestChannel_high);

SetIndexLabel(0,"WidestChannel_high");

SetIndexBuffer(1,InsideChannel_high);

SetIndexLabel(1,"InsideChannel_high");

SetIndexBuffer(2,StandardDeviation);

SetIndexLabel(2,"StandardDeviation");

SetIndexBuffer(3,InsideChannel_low);

SetIndexLabel(3,"InsideChannel_low");

SetIndexBuffer(4,WidestChannel_low);

SetIndexLabel(4,"WidestChannel_low");

return(0);

}

int deinit() {

ObjectDelete("regression channel");ObjectDelete("std channel");return(0);

}

int start() {

int counted_bars=IndicatorCounted(),limit, iTF;

//---- last counted bar will be recounted

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

//to refresh properly delete old objects...

ObjectDelete("regression channel");ObjectDelete("std channel");

//widest channel

ObjectCreate("regression channel",OBJ_STDDEVCHANNEL,0,iTime(Symbol(),STD.Rgres.period,STD.Rgres.length),

Close[STD.Rgres.length],Time[0],Close[0]);

ObjectSet("regression channel",OBJPROP_DEVIATION,STD.Rgres.width);

ObjectSet("regression channel",OBJPROP_COLOR,Orange);

ObjectSet("regression channel",OBJPROP_RAY,true);

//inside channel

ObjectCreate("std channel",OBJ_STDDEVCHANNEL,0,iTime(Symbol(),STD.Rgres.period,STD.Rgres.length),

Close[STD.Rgres.length],Time[0],Close[0]);

ObjectSet("std channel",OBJPROP_DEVIATION,STD.width);

ObjectSet("std channel",OBJPROP_COLOR,Olive);

ObjectSet("std channel",OBJPROP_RAY,true);

for(int i=0; i<limit; i++)

{

double dev = iStdDev(NULL,STD.Rgres.period,STD.Rgres.length,0,MODE_SMA,PRICE_CLOSE,i);

double innerWidth = STD.width*dev;

double outerWidth = STD.Rgres.width*dev;

double price = ObjectGetValueByShift("std channel", i);

WidestChannel_high= price + outerWidth/2;

InsideChannel_high= price + innerWidth/2;

StandardDeviation= price;

InsideChannel_low= price - innerWidth/2;

WidestChannel_low= price - outerWidth/2;

}

return(0);}
 
sunshineh:
こんにちは。

というのも、エラーが見つからないのに、間違った値だけが表示されるからです:-)

どなたか私の失敗をご覧になりましたか?

これは、インジケーターのコードです。

#property indicator_chart_window

#property indicator_buffers 5

double WidestChannel_high[];

double InsideChannel_high[];

double StandardDeviation[];

double InsideChannel_low[];

double WidestChannel_low[];

extern int STD.Rgres.period=0; /*default 0 means the channel will use the open

time from "x" bars back on which ever time period

the indicator is attached to. one can change to 1,5,

15,30,60...etc to "lock" the start time to a specific

period, and then view the "locked" channels on a different time period...*/

extern int STD.Rgres.length=56; // bars back regression begins

extern double STD.Rgres.width=1.618;// widest channel

extern double STD.width=0.618; // inside channel

int init()

{

SetIndexBuffer(0,WidestChannel_high);

SetIndexLabel(0,"WidestChannel_high");

SetIndexBuffer(1,InsideChannel_high);

SetIndexLabel(1,"InsideChannel_high");

SetIndexBuffer(2,StandardDeviation);

SetIndexLabel(2,"StandardDeviation");

SetIndexBuffer(3,InsideChannel_low);

SetIndexLabel(3,"InsideChannel_low");

SetIndexBuffer(4,WidestChannel_low);

SetIndexLabel(4,"WidestChannel_low");

return(0);

}

int deinit() {

ObjectDelete("regression channel");ObjectDelete("std channel");return(0);

}

int start() {

int counted_bars=IndicatorCounted(),limit, iTF;

//---- last counted bar will be recounted

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

//to refresh properly delete old objects...

ObjectDelete("regression channel");ObjectDelete("std channel");

//widest channel

ObjectCreate("regression channel",OBJ_STDDEVCHANNEL,0,iTime(Symbol(),STD.Rgres.period,STD.Rgres.length),

Close[STD.Rgres.length],Time[0],Close[0]);

ObjectSet("regression channel",OBJPROP_DEVIATION,STD.Rgres.width);

ObjectSet("regression channel",OBJPROP_COLOR,Orange);

ObjectSet("regression channel",OBJPROP_RAY,true);

//inside channel

ObjectCreate("std channel",OBJ_STDDEVCHANNEL,0,iTime(Symbol(),STD.Rgres.period,STD.Rgres.length),

Close[STD.Rgres.length],Time[0],Close[0]);

ObjectSet("std channel",OBJPROP_DEVIATION,STD.width);

ObjectSet("std channel",OBJPROP_COLOR,Olive);

ObjectSet("std channel",OBJPROP_RAY,true);

for(int i=0; i<limit; i++)

{

double dev = iStdDev(NULL,STD.Rgres.period,STD.Rgres.length,0,MODE_SMA,PRICE_CLOSE,i);

double innerWidth = STD.width*dev;

double outerWidth = STD.Rgres.width*dev;

double price = ObjectGetValueByShift("std channel", i);

WidestChannel_high= price + outerWidth/2;

InsideChannel_high= price + innerWidth/2;

StandardDeviation= price;

InsideChannel_low= price - innerWidth/2;

WidestChannel_low= price - outerWidth/2;

}

return(0);}

sunshineh,

高値と安値を得るために偏差を2で割る必要はありません。「/2」の部分を削除すれば、中値がOKであればOKです。チャンネルの幅は常に一定です:現在の標準偏差は、他の値ではなく、withに使用されるべきです。最後に、私が見る限り、ObjectGetValueByShift("std channel", i); は標準偏差 チャネルでは機能しません。それは私が知らない値を返すのですか(添付のインジケータを参照してください、私がその価格が何であるかわからないと言う理由がわかります)。

ファイル:
_test_4.mq4  3 kb
 

こんにちは、mladenです。

このインジケーターからヒントを得て、私のインジケーターや皆さんのインジケーターに適用し、リペイントやリフレッシュの問題やティックの問題を防ぐことは可能でしょうか? よろしくお願いします。

 
kenwa:
HI mladen, I attach a sample indicator using internal preset symbols, quite for me to understands inside , is possible to get some hints from this indicator to adapt to my indicators or/& yours indicators to prevent repaint or refresh shift line problem/tick problems or make some kind of sy nergy? よろしくお願いします。

ケンワ

逆コンパイルされたものには手を出しません。申し訳ありません。

 
mladen:
kenwa 私はデコンパイルされたものには手を出しません。すみません。

でも、不思議なことに、誰も見ていないのに、それがデコンパイルされたものだとわかるんです。

 
kenwa:
OK、私はそれを削除しますが、興味深いことに、なぜ誰もそれを表示しないが、あなたはそれがデコンパイルされたものであることがわかる

コーディングについて少し知っている人なら、それがデコンパイルされたコードであることは誰でも知っています。

そして、どんなコーディングのことを全く知らない人でも、このようなものがあれば.

/*

EX4-TO-MQ4デコンパイラ FREEWARE V4.0.451.1 [-] で生成されたものです。

ウェブサイトMetaTrader 5 Trading Platform / MetaQuotes Software Corp.

電子メール :support@metaquotes.net

*/

あなたが投稿したインジケータの最初の数行に書かれているように、それがデコンパイルされたコードであることを誰もが見ることができるように、むしろ明白であると思われるので、お願いします...

よろしくお願いします。

 

mladenさん、私のコードはデコンパイルされていないのですが、ちょっと見ていただけませんか?

 
Marbo:
mladen、私のコードはデコンパイルされていないのですが、ちょっと見ていただけますか?

マーボ

添付のようなことができます。対象時間枠のバーごとに1回、または状態(アラートのタイプ)が変化したときにアラートを出します。タイプを無視したい場合は、doAlertプロシージャでタイプチェックを スキップします。時間チェックを省略したい場合は(その場合はタイプのみチェック)、doAlertプロシージャの時間チェックを省略する。

ファイル:
test_4.mq4  3 kb
 

こんにちは、mladen。

あなたはおそらく、私が先週、MAクロスEAでいくつかの助けを求めたことを思い出すでしょう。私はこれをお願いするために尋ねるべきであるどこに示唆していることができます。私は見てきましたが、明白な答えが見つかりませんでした。あなたの記憶をリフレッシュするために、これは仕様でした。

1.SMA EMAのクロス

ろうそくの2.Onクローズ

新しい方向に新しい順序を置くと3.OCO

4.スリッページを調整する能力

クロスの5.Audible信号

6.クロスは設定可能なピップギャップがないと本当のクロスではありません。

7.If可能なキャンドル内の監視ので、キャンドルがATR(カウントする設定可能な数)よりもX倍である場合、注文はこのろうそくの方向にアラームで配置され、同様に注文を閉じるが、新しいものを開始しないようにするために

8。好ましくは、順序がアラームを鳴らすために7のように配置されている場合

9.クロスの信頼性は最も重要です。私のチャート(FXCM、Vantage、FX Choice)では、ユニバーサルクロスを含むいくつかのEAがトレードを行わないか、または遅すぎる。

10.SLは設定可能だが、必要なければ省くことができる。

11.トレーリングストップ

12.SLはXピップス利益後、自動的にブレークイーブンになる。

13.最大オープントレード数

14.マジックナンバー

取引条件

ジェフ