コーディングのヘルプ - ページ 202 1...195196197198199200201202203204205206207208209...786 新しいコメント daytrade5 2013.12.02 11:10 #2011 チャート上に出力されたテキストをエラーなく移動できない? 現在の範囲情報テキスト出力は、価格ローソク足で覆われています。私のコーディングスキルは、すべての試みがエラーに終わることで不十分である。私はちょうど図に示すように、チャート上のテキスト出力を移動しようとしています。どなたか助けていただけませんか?よろしくお願いします!!ant-gubreakout.mq4 ファイル: ant-gubreakout.mq4 10 kb screenshot.jpg 105 kb Mladen Rakic 2013.12.02 11:32 #2012 daytrade5: 現在の範囲情報のテキスト出力は、価格ローソクと被ります。私のコーディングスキルは不十分で、どの試みもエラーに終わります。ただ、チャート上のテキスト出力を図のように動かしたいだけなのです。どなたか助けていただけませんか?事前に多くの感謝を!!ant-gubreakout.mq4 デイ・トレード5 メタトレーダー4では、テキストタイプのオブジェクトのアンカーを選択することができません(メタトレーダー4では、このようなオブジェクトには常に固定アンカーが使用され、変更できません)。テキストの位置を変更する1つのバージョンを添付(そのためにTEXT_OFFSETを使用)しますが、時にはあなたはその値を変更する必要があり、整列は100%完璧ではありません。 ファイル: ant-gubreakout_1.mq4 10 kb daytrade5 2013.12.02 12:54 #2013 mladen: daytrade5 メタトレーダー4では、テキストタイプのオブジェクトのアンカーを選択することができません(メタトレーダー4は常に固定アンカーを使用するため、変更することができません)。テキストの位置を変更するバージョンを添付します(そのためにTEXT_OFFSETを使用します)しかし、時々、その値を変更する必要があり、整列は100%完璧ではありません。 OK...本当にありがとうございました。私はそれを理解することはなかっただろう。 zigflip 2013.12.03 04:11 #2014 注文が決済されるとアラートが送信されますが、現在ではアクションされた関連シンボルだけでなく、プロファイルで開いて いるチャートごとのシンボルに対して送信されます。 よろしくお願いします。 ファイル: alertcloseorderen.mq4 2 kb Mladen Rakic 2013.12.03 06:33 #2015 zigflip: 注文が決済されるとアラートが送信されますが、該当するシンボルだけでなく、プロファイルで開いているチャートごとに送信されます。よろしくお願いします。 ジグフリップ 今すぐ試す ファイル: alertcloseorderen_1.01.mq4 2 kb schmidt 2013.12.03 08:29 #2016 4つのCCから値を取得する方法がわからない こんにちは。 最初の問題は解決したんだけど、もう一つ質問があるんだ。 4cciはリペイントされますが、とても気に入っています。 この4つの値を別の自作インディケータに取り込もうとしているのですが、どうしても方法が見つかりません。 前のページのbool行を4cciの値で試してみましたが、私にはうまくいきませんでした。 経験豊富な方なら簡単に解決できるのでしょうが、私はすでに多くの時間を費やしており、解決できません。 アドバイスありがとうございました。 ボブ //------------------------------------------------------------------ #property copyright "mladen"#プロパティリンク "www.forex-tsd.cm" //------------------------------------------------------------------ #property indicator_separate_window(インジケーターウィンドウ)。 #property indicator_buffers 8 #property indicator_color1 LimeGreen (ライムグリーン) #property indicator_color2 PaleVioletRed (ペールバイオレットレッド) #property indicator_color3 ライムグリーン #property indicator_color4 ペールバイオレットレッド #property indicator_color5 LimeGreen (ライムグリーン) #property indicator_color6 ペールヴァイオレットレッド #プロパティインジケータ_color7 LimeGreen #property indicator_color8 PaleVioletRed (ペールバイオレットレッド) #property indicator_minimum 0 #property indicator_maximum 5 (最大値) // // // // // extern string TimeFrame1 = "現在のタイムフレーム"; extern string TimeFrame2 = "next1 "です。 extern string TimeFrame3 = "next2 "です。 extern string TimeFrame4 = "next3"。 extern int Period_CCI = 24; extern string UniqueID = "4 Time CCI Slopes"; extern int LinesWidth = 0; extern color LabelsColor = DarkGray; extern int LabelsHorizontalShift = 5; extern color LabelsColor = DarkGray; extern int LabelsHorizontalShift = 5; extern double LabelsVerticalShift = 1.5; extern bool alertsOn = false; extern int alertsLevel = 3; extern bool alertsMessage = FALSE; extern int alertsLevel = 3; extern bool alertsMessage = FALSE; extern bool alertsSound = false; extern bool alertsSound = false; extern bool alertsEmail = false; // // // // // double gosc1u[]; double gosc1d[]; double gosc2u[]; double gosc2d[]; double gosc3u[]; double gosc3d[]; double gosc4u[]; double gosc4d[]; int timeFrames[4]; bool returnBars; 文字列indicatorFileName; //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // int init() { SetIndexBuffer(0,gosc1u)を設定します。 SetIndexBuffer(1,gosc1d)を設定します。 SetIndexBuffer(2,gosc2u)を設定します。 SetIndexBuffer(3,gosc2d)を指定します。 SetIndexBuffer(4,gosc3u)を指定します。 SetIndexBuffer(5,gosc3d)を指定します。 SetIndexBuffer(6,gosc4u)を指定します。 SetIndexBuffer(7,gosc4d)。 indicatorFileName = WindowExpertName(); returnBars = (TimeFrame1=="returnBars"); if (returnBars) return(0); // // // // // for (int i=0; i<8; i++) { SetIndexStyle(i,DRAW_ARROW,EMPTY,LinesWidth); SetIndexArrow(i,110); } timeFrames[0] = stringToTimeFrame(TimeFrame1); timeFrames[1] = stringToTimeFrame(TimeFrame2); timeFrames[3] = stringToTimeFrame(TimeFrame2); timeFrames[2] = stringToTimeFrame(TimeFrame3); timeFrames[2] = stringToTimeFrame(TimeFrame3); timeFrames[3] = stringToTimeFrame(TimeFrame4)。 alertsLevel = MathMin(MathMax(alertsLevel,3),4); IndicatorShortName(UniqueID); return(0); } int deinit() { for (int t=0; t<4; t++) ObjectDelete(UniqueID+t); return(0); } //------------------------------------------------------------------ // //------------------------------------------------------------------ // // // // // double trend[][6]; #define _up 0 #define _dn 1 #define _hl1 2 #define _hl2 3 #define _hl3 4 #定義 _hl4 5 int start() { int i,r,count,counted_bars=IndicatorCounted(); if(counted_bars < 0) return(-1); if(counted_bars>0)counted_bars--。 int limit = MathMin(Bars-counted_bars,Bars-1); if (returnBars) { gosc1u[0] = limit+1; return(0); }. if (timeFrames[0] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[0],indicatorFileName, "returnBars",0,0)*timeFrames[0]/Period())). if (timeFrames[1] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[1],indicatorFileName, "returnBars",0,0)*timeFrames[1]/Period())). if (timeFrames[2] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[2],indicatorFileName, "returnBars",0,0)*timeFrames[2]/Period())). if (timeFrames[3] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[3],indicatorFileName, "returnBars",0,0)*timeFrames[3]/Period())). if (ArrayRange(trend,0)!=Bars) ArrayResize(trend,Bars); // // // // // bool initialized = false; if (!初期化) { initialized = true とする。 int window = WindowFind(UniqueID); for (int t=0; t<4; t++) { string label = timeFrameToString(timeFrames[t]); ObjectCreate(UniqueID+t,OBJ_TEXT,window,0,0); ObjectSet(UniqueID+t,OBJPROP_COLOR,LabelsColor); ObjectSet(UniqueID+t,OBJPROP_COLOR,LabelsColor); ObjectSet(UniqueID+t,OBJPROP_PRICE1,t+LabelsVerticalShift); ObjectSet(UniqueID+t,OBJPROP_PRICE1,t+LabelsVerticalShift); ObjectSetText(UniqueID+t,label,8, "Arial"); } } for (t=0; t<4; t++) ObjectSet(UniqueID+t,OBJPROP_TIME1,Time[0]+Period()*LabelsHorizontalShift*60); } } ObjectSetText(UniqueID+t,label,8, "Arial"); // // // // for(i = limit, r=Bars-i-1; i >= 0; i--,r++) { トレンド[r][_up] = 0; トレンド[r][_dn] = 0; trend[r][_hl1] = trend[r-1][_hl1]; trend[r][_hl2] = trend[r-1][_hl2]; trend[r][_hl3] = trend[r-1][_hl3]; trend[r][_hl4] = trend[r-1][_hl4]となります。 for (int k=0; k<4; k++) { int y = iBarShift(NULL,timeFrames[k],Time); double cciNow = iCCI(NULL, timeFrames[k], Period_CCI, PRICE_TYPICAL, y); double cciPre = iCCI(NULL, timeFrames[k], Period_CCI, PRICE_TYPICAL, y+1); double cciNow = iCCI(NULL, timeFrames[k], Period_CCI, PRICE_TYPICAL, y); if (cciNow>cciPre) trend[r][k+2] = 1; if (cciNow<cciPre) trend[r][k+2] = -1; if (cciNow<cciPre) trend[r][k+2] = -1; スイッチ (k) { case 0 : if (trend[r][k+2]==1) { gosc1u = k+1; gosc1d = EMPTY_VALUE;} else { gosc1d = k+1; gosc1u = EMPTY_VALUE; } break; case 1 : if (trend[r][k+2]==1) { gosc2u = k+1; gosc2d = EMPTY_VALUE;} else { gosc2d = k+1; gosc2u = EMPTY_VALUE;} break; case 2 : if (trend[r][k+2]==1) { gosc3u = k+1; gosc3d = EMPTY_VALUE;} else { gosc3d = k+1; gosc3u = EMPTY_VALUE;} break; case 3 : if (trend[r][k+2]==1) { gosc4u = k+1; gosc4d = EMPTY_VALUE;} else { gosc4d = k+1; gosc4u = EMPTY_VALUE;} break; } if (trend[r][k+2]==1)(トレンド[r][_up]) trend[r][_up] += 1; else trend[r][_dn] += 1; } } manageAlerts(); return(0); //+------------------------------------------------------------------- //| //+------------------------------------------------------------------- // // // // // void manageAlerts() { if (alertsOn) { int whichBar = Bars-1; if (トレンド[whichBar][_up] >= alertsLevel || トレンド[whichBar][_dn] >= alertsLevel) { if (trend[whichBar][_up] >= alertsLevel) doAlert("up",trend[whichBar][_up])。 if (trend[whichBar][_dn] >= alertsLevel) doAlert("down",trend[whichBar][_dn])となります。 } } } // // // // // void doAlert(string doWhat, int howMany) { 静的な文字列previousAlert="何もない"; static datetime previousTime; 文字列メッセージ if (previousAlert != doWhat || previousTime != Time[0]) { previousAlert = doWhat; previousTime = Time[0]。 // // // // // message = Symbol()+" at "+TimeToStr(TimeLocal(),TIME_SECONDS)+" "+howMany+" time frames of MA trends are aligned "+doWhat; if (alertsMessage) アラート(メッセージ)。 if (alertsEmail) SendMail(Symbol()+" 4 time frame MA trends",message)。 if (alertsSound) PlaySound("alert2.wav")。 //------------------------------------------------------------------- // //------------------------------------------------------------------- // // // // string sTfTable[] = {"M1", "M5", "M15", "M30", "H1", "H4", "D1", "W1", "MN"}; int iTfTable[] = {"M1", "M5", "M15", "M30", "D1", "W1", "MN"}; int iTfTable[] = {1,5,15,30,60,240,1440,10080,43200}; // // // // int toInt(double value) { return(value); }. int stringToTimeFrame(string tfs) { tfs = stringUpperCase(tfs); int max = ArraySize(iTfTable)-1, add=0; int nxt = (StringFind(tfs, "NEXT1")>-1); if (nxt>0) { tfs = ""+Period(); add=1; }. nxt = (StringFind(tfs, "NEXT2")>-1); if (nxt>0) { tfs = ""+Period(); add=2; }. nxt = (StringFind(tfs, "NEXT3")>-1); if (nxt>0) { tfs = ""+Period(); add=3; } }. // // // // // for (int i=max; i>=0; i--) if (tfs==sTfTable || tfs==""+iTfTable) return(MathMax(iTfTable[toInt(MathMin(max,i+add))],Period())); return(Period())。 } 文字列 timeFrameToString(int tf) { for (int i=ArraySize(iTfTable)-1; i>=0; i--) if (tf==iTfTable) return(sTfTable); return(""); } // // // // // 文字列 stringUpperCase(string str) { 文字列 s = str; for (int length=StringLen(str)-1; length>=0; length--) { int char = StringGetChar(s, length); if((char > 96 && char 223 && char < 256)) s = StringSetChar(s, length, char - 32); else if(char > -33 && char < 0) s = StringSetChar(s, length, char + 224); } return(s); } Mladen Rakic 2013.12.03 09:04 #2017 BobMorane1000: hello最初の問題は解決したのですが、もう一つ質問があります。 mladenの4cciはとても気に入っています。リペイントされるのは分かっていますが、それでも私にはとても効果的です。 この4つの値を別の自作インディケータに取り込もうとしているのですが、どうしても方法が見つかりません。 前のページのbool行を4cciの値で試してみましたが、私にはうまくいきませんでした。 経験豊富な方なら簡単に解決できるのでしょうが、私はすでに多くの時間を費やしており、解決できません。 アドバイスありがとうございました。 ボブ BobMorane1000 4回の代わりにiCCI() コールを単純に使ってはどうでしょうか(コード的にももっとシンプルになります)? schmidt 2013.12.03 10:01 #2018 おっしゃるとおり、そうします。 ありがとうございました。 kingsleyedeh4re 2013.12.03 11:05 #2019 このストキャスティックの十字架に矢印をつけるのを手伝ってくれる人はいますか? ファイル: ds_stochastic.mq4 4 kb wolf1210 2013.12.03 12:16 #2020 [ATTACH]187655 こんにちは、私は助けを必要としています。 私は、キャンドルが緑色に着色され、トレンドのために読んでいる素敵なTrendindicatoeを持っています。しかし、バグがあります:その色は、タイムフレームを変更するときに同じままであることができません。しかし、悪いことに、ウィッグはほとんど見られず、私はこれを変更することはできないという事実である。 どなたか見ていただけませんか? どうもありがとうございました。私はインジケータを添付します。 ファイル: t3_thv.ex4 5 kb 1...195196197198199200201202203204205206207208209...786 新しいコメント 取引の機会を逃しています。 無料取引アプリ 8千を超えるシグナルをコピー 金融ニュースで金融マーケットを探索 新規登録 ログイン スペースを含まないラテン文字 このメールにパスワードが送信されます エラーが発生しました Googleでログイン WebサイトポリシーおよびMQL5.COM利用規約に同意します。 新規登録 MQL5.com WebサイトへのログインにCookieの使用を許可します。 ログインするには、ブラウザで必要な設定を有効にしてください。 ログイン/パスワードをお忘れですか? Googleでログイン
チャート上に出力されたテキストをエラーなく移動できない?
現在の範囲情報テキスト出力は、価格ローソク足で覆われています。私のコーディングスキルは、すべての試みがエラーに終わることで不十分である。私はちょうど図に示すように、チャート上のテキスト出力を移動しようとしています。どなたか助けていただけませんか?よろしくお願いします!!ant-gubreakout.mq4![](https://c.mql5.com/forextsd/forum/124/screenshot.jpg)
現在の範囲情報のテキスト出力は、価格ローソクと被ります。私のコーディングスキルは不十分で、どの試みもエラーに終わります。ただ、チャート上のテキスト出力を図のように動かしたいだけなのです。どなたか助けていただけませんか?事前に多くの感謝を!!ant-gubreakout.mq4
デイ・トレード5
メタトレーダー4では、テキストタイプのオブジェクトのアンカーを選択することができません(メタトレーダー4では、このようなオブジェクトには常に固定アンカーが使用され、変更できません)。テキストの位置を変更する1つのバージョンを添付(そのためにTEXT_OFFSETを使用)しますが、時にはあなたはその値を変更する必要があり、整列は100%完璧ではありません。
daytrade5 メタトレーダー4では、テキストタイプのオブジェクトのアンカーを選択することができません(メタトレーダー4は常に固定アンカーを使用するため、変更することができません)。テキストの位置を変更するバージョンを添付します(そのためにTEXT_OFFSETを使用します)しかし、時々、その値を変更する必要があり、整列は100%完璧ではありません。
OK...本当にありがとうございました。私はそれを理解することはなかっただろう。
注文が決済されるとアラートが送信されますが、現在ではアクションされた関連シンボルだけでなく、プロファイルで開いて いるチャートごとのシンボルに対して送信されます。
よろしくお願いします。![](https://c.mql5.com/forextsd/smiles/rolleyes2.png)
注文が決済されるとアラートが送信されますが、該当するシンボルだけでなく、プロファイルで開いているチャートごとに送信されます。よろしくお願いします。
ジグフリップ
今すぐ試す
4つのCCから値を取得する方法がわからない
こんにちは。
最初の問題は解決したんだけど、もう一つ質問があるんだ。![](https://c.mql5.com/forextsd/smiles/smile.png)
4cciはリペイントされますが、とても気に入っています。
この4つの値を別の自作インディケータに取り込もうとしているのですが、どうしても方法が見つかりません。
前のページのbool行を4cciの値で試してみましたが、私にはうまくいきませんでした。
経験豊富な方なら簡単に解決できるのでしょうが、私はすでに多くの時間を費やしており、解決できません。
アドバイスありがとうございました。
ボブ
#property copyright "mladen"
#プロパティリンク "www.forex-tsd.cm"
//------------------------------------------------------------------
#property indicator_separate_window(インジケーターウィンドウ)。
#property indicator_buffers 8
#property indicator_color1 LimeGreen (ライムグリーン)
#property indicator_color2 PaleVioletRed (ペールバイオレットレッド)
#property indicator_color3 ライムグリーン
#property indicator_color4 ペールバイオレットレッド
#property indicator_color5 LimeGreen (ライムグリーン)
#property indicator_color6 ペールヴァイオレットレッド
#プロパティインジケータ_color7 LimeGreen
#property indicator_color8 PaleVioletRed (ペールバイオレットレッド)
#property indicator_minimum 0
#property indicator_maximum 5 (最大値)
//
//
//
//
//
extern string TimeFrame1 = "現在のタイムフレーム";
extern string TimeFrame2 = "next1 "です。
extern string TimeFrame3 = "next2 "です。
extern string TimeFrame4 = "next3"。
extern int Period_CCI = 24;
extern string UniqueID = "4 Time CCI Slopes";
extern int LinesWidth = 0;
extern color LabelsColor = DarkGray;
extern int LabelsHorizontalShift = 5; extern color LabelsColor = DarkGray; extern int LabelsHorizontalShift = 5;
extern double LabelsVerticalShift = 1.5;
extern bool alertsOn = false;
extern int alertsLevel = 3;
extern bool alertsMessage = FALSE; extern int alertsLevel = 3; extern bool alertsMessage = FALSE;
extern bool alertsSound = false; extern bool alertsSound = false;
extern bool alertsEmail = false;
//
//
//
//
//
double gosc1u[];
double gosc1d[];
double gosc2u[];
double gosc2d[];
double gosc3u[];
double gosc3d[];
double gosc4u[];
double gosc4d[];
int timeFrames[4];
bool returnBars;
文字列indicatorFileName;
//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//
int init()
{
SetIndexBuffer(0,gosc1u)を設定します。
SetIndexBuffer(1,gosc1d)を設定します。
SetIndexBuffer(2,gosc2u)を設定します。
SetIndexBuffer(3,gosc2d)を指定します。
SetIndexBuffer(4,gosc3u)を指定します。
SetIndexBuffer(5,gosc3d)を指定します。
SetIndexBuffer(6,gosc4u)を指定します。
SetIndexBuffer(7,gosc4d)。
indicatorFileName = WindowExpertName();
returnBars = (TimeFrame1=="returnBars"); if (returnBars) return(0);
//
//
//
//
//
for (int i=0; i<8; i++)
{
SetIndexStyle(i,DRAW_ARROW,EMPTY,LinesWidth); SetIndexArrow(i,110);
}
timeFrames[0] = stringToTimeFrame(TimeFrame1);
timeFrames[1] = stringToTimeFrame(TimeFrame2); timeFrames[3] = stringToTimeFrame(TimeFrame2);
timeFrames[2] = stringToTimeFrame(TimeFrame3); timeFrames[2] = stringToTimeFrame(TimeFrame3);
timeFrames[3] = stringToTimeFrame(TimeFrame4)。
alertsLevel = MathMin(MathMax(alertsLevel,3),4);
IndicatorShortName(UniqueID);
return(0);
}
int deinit()
{
for (int t=0; t<4; t++) ObjectDelete(UniqueID+t);
return(0);
}
//------------------------------------------------------------------
//
//------------------------------------------------------------------
//
//
//
//
//
double trend[][6];
#define _up 0
#define _dn 1
#define _hl1 2
#define _hl2 3
#define _hl3 4
#定義 _hl4 5
int start()
{
int i,r,count,counted_bars=IndicatorCounted();
if(counted_bars < 0) return(-1);
if(counted_bars>0)counted_bars--。
int limit = MathMin(Bars-counted_bars,Bars-1);
if (returnBars) { gosc1u[0] = limit+1; return(0); }.
if (timeFrames[0] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[0],indicatorFileName, "returnBars",0,0)*timeFrames[0]/Period())).
if (timeFrames[1] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[1],indicatorFileName, "returnBars",0,0)*timeFrames[1]/Period())).
if (timeFrames[2] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[2],indicatorFileName, "returnBars",0,0)*timeFrames[2]/Period())).
if (timeFrames[3] != Period()) limit = MathMax(limit,MathMin(Bars-1,iCustom(NULL,timeFrames[3],indicatorFileName, "returnBars",0,0)*timeFrames[3]/Period())).
if (ArrayRange(trend,0)!=Bars) ArrayResize(trend,Bars);
//
//
//
//
//
bool initialized = false;
if (!初期化)
{
initialized = true とする。
int window = WindowFind(UniqueID);
for (int t=0; t<4; t++)
{
string label = timeFrameToString(timeFrames[t]);
ObjectCreate(UniqueID+t,OBJ_TEXT,window,0,0);
ObjectSet(UniqueID+t,OBJPROP_COLOR,LabelsColor); ObjectSet(UniqueID+t,OBJPROP_COLOR,LabelsColor);
ObjectSet(UniqueID+t,OBJPROP_PRICE1,t+LabelsVerticalShift); ObjectSet(UniqueID+t,OBJPROP_PRICE1,t+LabelsVerticalShift);
ObjectSetText(UniqueID+t,label,8, "Arial");
}
}
for (t=0; t<4; t++) ObjectSet(UniqueID+t,OBJPROP_TIME1,Time[0]+Period()*LabelsHorizontalShift*60); } } ObjectSetText(UniqueID+t,label,8, "Arial");
//
//
//
//
for(i = limit, r=Bars-i-1; i >= 0; i--,r++)
{
トレンド[r][_up] = 0;
トレンド[r][_dn] = 0;
trend[r][_hl1] = trend[r-1][_hl1];
trend[r][_hl2] = trend[r-1][_hl2];
trend[r][_hl3] = trend[r-1][_hl3];
trend[r][_hl4] = trend[r-1][_hl4]となります。
for (int k=0; k<4; k++)
{
int y = iBarShift(NULL,timeFrames[k],Time);
double cciNow = iCCI(NULL, timeFrames[k], Period_CCI, PRICE_TYPICAL, y);
double cciPre = iCCI(NULL, timeFrames[k], Period_CCI, PRICE_TYPICAL, y+1); double cciNow = iCCI(NULL, timeFrames[k], Period_CCI, PRICE_TYPICAL, y);
if (cciNow>cciPre) trend[r][k+2] = 1;
if (cciNow<cciPre) trend[r][k+2] = -1; if (cciNow<cciPre) trend[r][k+2] = -1;
スイッチ (k)
{
case 0 : if (trend[r][k+2]==1) { gosc1u = k+1; gosc1d = EMPTY_VALUE;} else { gosc1d = k+1; gosc1u = EMPTY_VALUE; } break;
case 1 : if (trend[r][k+2]==1) { gosc2u = k+1; gosc2d = EMPTY_VALUE;} else { gosc2d = k+1; gosc2u = EMPTY_VALUE;} break;
case 2 : if (trend[r][k+2]==1) { gosc3u = k+1; gosc3d = EMPTY_VALUE;} else { gosc3d = k+1; gosc3u = EMPTY_VALUE;} break;
case 3 : if (trend[r][k+2]==1) { gosc4u = k+1; gosc4d = EMPTY_VALUE;} else { gosc4d = k+1; gosc4u = EMPTY_VALUE;} break;
}
if (trend[r][k+2]==1)(トレンド[r][_up])
trend[r][_up] += 1;
else trend[r][_dn] += 1;
}
}
manageAlerts();
return(0);
//+-------------------------------------------------------------------
//|
//+-------------------------------------------------------------------
//
//
//
//
//
void manageAlerts()
{
if (alertsOn)
{
int whichBar = Bars-1;
if (トレンド[whichBar][_up] >= alertsLevel || トレンド[whichBar][_dn] >= alertsLevel)
{
if (trend[whichBar][_up] >= alertsLevel) doAlert("up",trend[whichBar][_up])。
if (trend[whichBar][_dn] >= alertsLevel) doAlert("down",trend[whichBar][_dn])となります。
}
}
}
//
//
//
//
//
void doAlert(string doWhat, int howMany)
{
静的な文字列previousAlert="何もない";
static datetime previousTime;
文字列メッセージ
if (previousAlert != doWhat || previousTime != Time[0]) {
previousAlert = doWhat;
previousTime = Time[0]。
//
//
//
//
//
message = Symbol()+" at "+TimeToStr(TimeLocal(),TIME_SECONDS)+" "+howMany+" time frames of MA trends are aligned "+doWhat;
if (alertsMessage) アラート(メッセージ)。
if (alertsEmail) SendMail(Symbol()+" 4 time frame MA trends",message)。
if (alertsSound) PlaySound("alert2.wav")。
//-------------------------------------------------------------------
//
//-------------------------------------------------------------------
//
//
//
//
string sTfTable[] = {"M1", "M5", "M15", "M30", "H1", "H4", "D1", "W1", "MN"}; int iTfTable[] = {"M1", "M5", "M15", "M30", "D1", "W1", "MN"};
int iTfTable[] = {1,5,15,30,60,240,1440,10080,43200};
//
//
//
//
int toInt(double value) { return(value); }.
int stringToTimeFrame(string tfs)
{
tfs = stringUpperCase(tfs);
int max = ArraySize(iTfTable)-1, add=0;
int nxt = (StringFind(tfs, "NEXT1")>-1); if (nxt>0) { tfs = ""+Period(); add=1; }.
nxt = (StringFind(tfs, "NEXT2")>-1); if (nxt>0) { tfs = ""+Period(); add=2; }.
nxt = (StringFind(tfs, "NEXT3")>-1); if (nxt>0) { tfs = ""+Period(); add=3; } }.
//
//
//
//
//
for (int i=max; i>=0; i--)
if (tfs==sTfTable || tfs==""+iTfTable) return(MathMax(iTfTable[toInt(MathMin(max,i+add))],Period()));
return(Period())。
}
文字列 timeFrameToString(int tf)
{
for (int i=ArraySize(iTfTable)-1; i>=0; i--)
if (tf==iTfTable) return(sTfTable);
return("");
}
//
//
//
//
//
文字列 stringUpperCase(string str)
{
文字列 s = str;
for (int length=StringLen(str)-1; length>=0; length--)
{
int char = StringGetChar(s, length);
if((char > 96 && char 223 && char < 256))
s = StringSetChar(s, length, char - 32);
else if(char > -33 && char < 0)
s = StringSetChar(s, length, char + 224);
}
return(s);
}hello
最初の問題は解決したのですが、もう一つ質問があります。![](https://c.mql5.com/forextsd/smiles/smile.png)
mladenの4cciはとても気に入っています。リペイントされるのは分かっていますが、それでも私にはとても効果的です。
この4つの値を別の自作インディケータに取り込もうとしているのですが、どうしても方法が見つかりません。
前のページのbool行を4cciの値で試してみましたが、私にはうまくいきませんでした。
経験豊富な方なら簡単に解決できるのでしょうが、私はすでに多くの時間を費やしており、解決できません。
アドバイスありがとうございました。
ボブBobMorane1000
4回の代わりにiCCI() コールを単純に使ってはどうでしょうか(コード的にももっとシンプルになります)?
おっしゃるとおり、そうします。
ありがとうございました。
このストキャスティックの十字架に矢印をつけるのを手伝ってくれる人はいますか?
[ATTACH]187655
こんにちは、私は助けを必要としています。
私は、キャンドルが緑色に着色され、トレンドのために読んでいる素敵なTrendindicatoeを持っています。しかし、バグがあります:その色は、タイムフレームを変更するときに同じままであることができません。しかし、悪いことに、ウィッグはほとんど見られず、私はこれを変更することはできないという事実である。
どなたか見ていただけませんか?
どうもありがとうございました。私はインジケータを添付します。