안녕하세요 프로그래머, 저는 stepMA 평균 공식으로 가격 막대를 그리는 지표를 만들려고 합니다. 엘리트 지표이기 때문에 여기에 넣을 수 있는지 확신할 수 없었지만 iCustom 함수 를 사용하여 해당 지표의 MTF 버전을 만들었기 때문에 제 코드에는 원래 공식의 흔적이 없습니다.
컴파일러에서 오류가 전혀 발생하지 않지만 표시기가 제대로 작동하지 않습니다. 버퍼를 엉망으로 만든 것 같습니다. 당신이 나를 도울 수?
thefxpros: 안녕하세요 프로그래머, 저는 stepMA 평균 공식으로 가격 막대를 그리는 지표를 만들려고 합니다. 엘리트 지표이기 때문에 여기에 넣을 수 있는지 확신할 수 없었지만 iCustom 함수를 사용하여 해당 지표의 MTF 버전을 생성했기 때문에 제 코드에는 원래 공식의 흔적이 없습니다.
컴파일러에서 오류가 전혀 발생하지 않지만 표시기가 제대로 작동하지 않습니다. 버퍼를 엉망으로 만든 것 같습니다. 당신이 나를 도울 수?
thefxpros: 안녕하세요 프로그래머, 저는 stepMA 평균 공식으로 가격 막대를 그리는 지표를 만들려고 합니다. 엘리트 지표이기 때문에 여기에 넣을 수 있는지 확신할 수 없었지만 iCustom 함수를 사용하여 해당 지표의 MTF 버전을 생성했기 때문에 제 코드에는 원래 공식의 흔적이 없습니다.
컴파일러에서 오류가 전혀 발생하지 않지만 표시기가 제대로 작동하지 않습니다. 버퍼를 엉망으로 만든 것 같습니다. 당신이 나를 도울 수?
지표 수정 도움말
안녕하세요 여러분
이 MA 교차 표시기는 매 틱마다 경고를 생성합니다. 문제를 해결하거나 적어도 방법을 가르쳐 줄 사람이 있습니까?
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
double g_ibuf_76[];
double g_ibuf_80[];
int g_period_84 = 5;
int g_period_88 = 34;
extern bool Alerts = TRUE;
extern bool PopAlerts = TRUE;
extern bool PushAlerts = TRUE;
extern bool EmailAlerts = TRUE;
extern bool SoundAlerts = TRUE;
extern string SoundFileUp = "UP.wav";
extern string SoundFileDn = "DN.wav";
int gi_96 = 0;
int gi_100 = 0;
int init() {
SetIndexStyle(0, DRAW_ARROW, EMPTY);
SetIndexArrow(0, 233);
SetIndexBuffer(0, g_ibuf_76);
SetIndexStyle(1, DRAW_ARROW, EMPTY);
SetIndexArrow(1, 234);
SetIndexBuffer(1, g_ibuf_80);
return (0);
}
int deinit() {
return (0);
}
int start() {
int li_20;
double l_ima_24;
double l_ima_32;
double l_ima_40;
double l_ima_48;
double l_ima_56;
double l_ima_64;
double ld_72;
double ld_80;
int li_88 = IndicatorCounted();
if (li_88 < 0) return (-1);
if (li_88 > 0) li_88--;
int li_12 = Bars - li_88;
for (int li_16 = 0; li_16 <= li_12; li_16++) {
li_20 = li_16;
ld_72 = 0;
ld_80 = 0;
for (li_20 = li_16; li_20 <= li_16 + 9; li_20++) ld_80 += MathAbs(High[li_20] - Low[li_20]);
ld_72 = ld_80 / 10.0;
l_ima_24 = iMA(NULL, 0, g_period_84, 0, MODE_EMA, PRICE_CLOSE, li_16);
l_ima_40 = iMA(NULL, 0, g_period_84, 0, MODE_EMA, PRICE_CLOSE, li_16 + 1);
l_ima_56 = iMA(NULL, 0, g_period_84, 0, MODE_EMA, PRICE_CLOSE, li_16 - 1);
l_ima_32 = iMA(NULL, 0, g_period_88, 0, MODE_EMA, PRICE_CLOSE, li_16);
l_ima_48 = iMA(NULL, 0, g_period_88, 0, MODE_EMA, PRICE_CLOSE, li_16 + 1);
l_ima_64 = iMA(NULL, 0, g_period_88, 0, MODE_EMA, PRICE_CLOSE, li_16 - 1);
if (l_ima_24 > l_ima_32 && l_ima_40 l_ima_64) {
g_ibuf_76[li_16] = Low[li_16] - ld_72 / 2.0;
if (li_16 <= 2 && Alerts && !gi_100) {
if (PopAlerts) Alert(Symbol(), " ", Period(), " PRE-BUY ");
if (PushAlerts) SendNotification(Symbol() + " PRE-BUY ");
if (SoundAlerts) PlaySound(SoundFileUp);
if (EmailAlerts) SendMail(Symbol() , " PRE-BUY ");
gi_96 = TRUE;
gi_100 = FALSE;
}
} else {
if (l_ima_24 l_ima_48 && l_ima_56 < l_ima_64) {
g_ibuf_80[li_16] = High[li_16] + ld_72 / 2.0;
if (li_16 <= 2 && Alerts && !gi_100) {
if (PopAlerts) Alert(Symbol(), " ", Period(), " PRE-SELL ");
if (PushAlerts) SendNotification(Symbol() + " PRE-SELL ");
if (SoundAlerts) PlaySound(SoundFileUp);
if (EmailAlerts) SendMail(Symbol() , " PRE-SELL ");
gi_100 = TRUE;
gi_96 = FALSE;
}
}
}
}
return (0);
}
문안 인사
아민
안녕하세요 여러분
이 MA 교차 표시기는 매 틱마다 경고를 생성합니다. 문제를 해결하거나 적어도 방법을 가르쳐 줄 사람이 있습니까?
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
double g_ibuf_76[];
double g_ibuf_80[];
int g_period_84 = 5;
int g_period_88 = 34;
extern bool Alerts = TRUE;
extern bool PopAlerts = TRUE;
extern bool PushAlerts = TRUE;
extern bool EmailAlerts = TRUE;
extern bool SoundAlerts = TRUE;
extern string SoundFileUp = "UP.wav";
extern string SoundFileDn = "DN.wav";
int gi_96 = 0;
int gi_100 = 0;
int init() {
SetIndexStyle(0, DRAW_ARROW, EMPTY);
SetIndexArrow(0, 233);
SetIndexBuffer(0, g_ibuf_76);
SetIndexStyle(1, DRAW_ARROW, EMPTY);
SetIndexArrow(1, 234);
SetIndexBuffer(1, g_ibuf_80);
return (0);
}
int deinit() {
return (0);
}
int start() {
int li_20;
double l_ima_24;
double l_ima_32;
double l_ima_40;
double l_ima_48;
double l_ima_56;
double l_ima_64;
double ld_72;
double ld_80;
int li_88 = IndicatorCounted();
if (li_88 < 0) return (-1);
if (li_88 > 0) li_88--;
int li_12 = Bars - li_88;
for (int li_16 = 0; li_16 <= li_12; li_16++) {
li_20 = li_16;
ld_72 = 0;
ld_80 = 0;
for (li_20 = li_16; li_20 <= li_16 + 9; li_20++) ld_80 += MathAbs(High[li_20] - Low[li_20]);
ld_72 = ld_80 / 10.0;
l_ima_24 = iMA(NULL, 0, g_period_84, 0, MODE_EMA, PRICE_CLOSE, li_16);
l_ima_40 = iMA(NULL, 0, g_period_84, 0, MODE_EMA, PRICE_CLOSE, li_16 + 1);
l_ima_56 = iMA(NULL, 0, g_period_84, 0, MODE_EMA, PRICE_CLOSE, li_16 - 1);
l_ima_32 = iMA(NULL, 0, g_period_88, 0, MODE_EMA, PRICE_CLOSE, li_16);
l_ima_48 = iMA(NULL, 0, g_period_88, 0, MODE_EMA, PRICE_CLOSE, li_16 + 1);
l_ima_64 = iMA(NULL, 0, g_period_88, 0, MODE_EMA, PRICE_CLOSE, li_16 - 1);
if (l_ima_24 > l_ima_32 && l_ima_40 l_ima_64) {
g_ibuf_76[li_16] = Low[li_16] - ld_72 / 2.0;
if (li_16 <= 2 && Alerts && !gi_100) {
if (PopAlerts) Alert(Symbol(), " ", Period(), " PRE-BUY ");
if (PushAlerts) SendNotification(Symbol() + " PRE-BUY ");
if (SoundAlerts) PlaySound(SoundFileUp);
if (EmailAlerts) SendMail(Symbol() , " PRE-BUY ");
gi_96 = TRUE;
gi_100 = FALSE;
}
} else {
if (l_ima_24 l_ima_48 && l_ima_56 < l_ima_64) {
g_ibuf_80[li_16] = High[li_16] + ld_72 / 2.0;
if (li_16 <= 2 && Alerts && !gi_100) {
if (PopAlerts) Alert(Symbol(), " ", Period(), " PRE-SELL ");
if (PushAlerts) SendNotification(Symbol() + " PRE-SELL ");
if (SoundAlerts) PlaySound(SoundFileUp);
if (EmailAlerts) SendMail(Symbol() , " PRE-SELL ");
gi_100 = TRUE;
gi_96 = FALSE;
}
}
}
}
return (0);
}
문안 인사
아민Amin은 당신이 발견한 문제가 있는 다시 그리기 표시기의 디컴파일 버전입니다. 대신 이 게시물의 표시기를 사용하십시오: https://www.mql5.com/en/forum/173574/page447
안녕하세요 코더 여러분!
색상이 변경되는 순간 이 표시기에 경고 옵션을 추가할 수 있습니까?
가장 중요한 것은 가능한 한 빨리 경고를 보내는 것입니다(항상 양초가 열릴 때 발생합니다).
옵션 1: 이메일: (TRUE/FALSE)
옵션 2: 상자: (TRUE/FALSE)
이메일 또는 상자의 제목에 표시할 텍스트: [PAIR] 켜짐 TF [TF]
나는 당신의 시간을 존중하기 때문에 먼저 코딩을 시도했지만 운이 없었습니다.
누군가가 나를 도울 수 있기를 바랍니다.
미리 감사드립니다!
hama.mq4
안녕하세요 프로그래머, 저는 stepMA 평균 공식으로 가격 막대를 그리는 지표를 만들려고 합니다. 엘리트 지표이기 때문에 여기에 넣을 수 있는지 확신할 수 없었지만 iCustom 함수 를 사용하여 해당 지표의 MTF 버전을 만들었기 때문에 제 코드에는 원래 공식의 흔적이 없습니다.
컴파일러에서 오류가 전혀 발생하지 않지만 표시기가 제대로 작동하지 않습니다. 버퍼를 엉망으로 만든 것 같습니다. 당신이 나를 도울 수?
미리 감사드립니다.
내 코드는 다음과 같습니다.
#property copyright "mladen"
#property link "www.forex-tsd.com"
//------------------------------------------------------------------
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 DarkGreen
#property indicator_width1 1
#property indicator_color2 FireBrick
#property indicator_width2 1
#property indicator_color3 LimeGreen
#property indicator_width3 2
#property indicator_color4 Orange
#property indicator_width4 2
//
//
//
extern int TimeFrame = 0; // Timeframe
extern int MaLength = 10; // Ma Length
extern int MaMethod = 18; // Ma method
extern double Sensitivity = 3; // Sensivity Factor
extern double StepSize = 3; // Constant Step Size
extern int Shift = 0; // OShify
extern bool HighLow = false; // High/Low Mode Switch (more sensitive)
extern color WickBuyColor = DarkGreen;
extern color WickSellColor = FireBrick;
extern color BodyBuyColor = LimeGreen;
extern color BodySellColor = Orange;
extern int WickWidth = 1;
extern int BodyWidth = 2;
extern bool alertsOn = false;
extern bool alertsOnCurrent = false;
extern bool alertsMessage = false;
extern bool alertsNotification = false;
extern bool alertsSound = false;
extern bool alertsEmail = false;
extern string MaMethods = "";
extern string __0 = "SMA";
extern string __1 = "EMA";
extern string __2 = "Double smoothed EMA";
extern string __3 = "Double EMA (DEMA)";
extern string __4 = "Triple EMA (TEMA)";
extern string __5 = "Smoothed MA";
extern string __6 = "Linear weighted MA";
extern string __7 = "Parabolic weighted MA";
extern string __8 = "Alexander MA";
extern string __9 = "Volume weghted MA";
extern string __10 = "Hull MA";
extern string __11 = "Triangular MA";
extern string __12 = "Sine weighted MA";
extern string __13 = "Linear regression";
extern string __14 = "IE/2";
extern string __15 = "NonLag MA";
extern string __16 = "Zero lag EMA";
extern string __17 = "Leader EMA";
extern string __18 = "Super smoother";
extern string __19 = "Smoother";
//
//
//
double MABuffer[];
double UpBuffer[];
double DnBuffer[];
double UpbBuffer[];
double DnbBuffer[];
double slope[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(6);
SetIndexBuffer(0,UpBuffer); SetIndexStyle(0,DRAW_HISTOGRAM, EMPTY, WickWidth, WickBuyColor);
SetIndexBuffer(1,DnBuffer); SetIndexStyle(1,DRAW_HISTOGRAM, EMPTY, WickWidth, WickSellColor);
SetIndexBuffer(2,UpbBuffer); SetIndexStyle(2,DRAW_HISTOGRAM, EMPTY, BodyWidth, BodyBuyColor);
SetIndexBuffer(3,DnbBuffer); SetIndexStyle(3,DRAW_HISTOGRAM, EMPTY, BodyWidth, BodySellColor);
SetIndexBuffer(4,MABuffer);
SetIndexBuffer(5,slope);
IndicatorShortName("StepMA averages MTF candles("+MaLength+","+Sensitivity+","+StepSize+")");
MaLength = MathMax(MaLength,1);
switch(TimeFrame)
{
case 1 : string TimeFrameStr="Period_M1"; break;
case 5 : TimeFrameStr="Period_M5"; break;
case 15 : TimeFrameStr="Period_M15"; break;
case 30 : TimeFrameStr="Period_M30"; break;
case 60 : TimeFrameStr="Period_H1"; break;
case 240 : TimeFrameStr="Period_H4"; break;
case 1440 : TimeFrameStr="Period_D1"; break;
case 10080 : TimeFrameStr="Period_W1"; break;
case 43200 : TimeFrameStr="Period_MN1"; break;
default : TimeFrameStr="Current Timeframe";
}
IndicatorShortName("StepMA averages MTF candles ("+TimeFrameStr+")");
return(0);
}
//----
//+------------------------------------------------------------------+
//| MTF function |
//+------------------------------------------------------------------+
int start()
{
datetime TimeArray[];
int i,limit,y=0,counted_bars=IndicatorCounted();
// Plot defined time frame on to current time frame
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);
limit= MathMin(Bars-counted_bars+3*TimeFrame/Period(),Bars-1);
for(i=0,y=0;i<limit;i++)
{
if (Time<TimeArray[y]) y++;
/*********************************************************************************************************
Add your main indicator loop below. You can reference an existing indicator with its iName or iCustom.
Rule 1: Add extern inputs above for all neccesary values
Rule 2: Use 'TimeFrame' for the indicator time frame
Rule 3: Use 'y' for your indicator's shift value
********************************************************************************************************/
MABuffer=iCustom(Symbol(),TimeFrame,"StepMA averages",MaLength,MaMethod,Sensitivity,StepSize,Shift,HighLow,0,y);
slope = slope;
if (MABuffer>MABuffer) slope = 1;
if (MABuffer<MABuffer) slope = -1;
if (slope == 1) { UpBuffer=High; DnBuffer=Low; UpbBuffer = MathMax(Open,Close); DnbBuffer = MathMin(Open,Close); }
if (slope == -1) { DnBuffer=High; UpBuffer=Low; DnbBuffer = MathMax(Open,Close); UpbBuffer = MathMin(Open,Close); }
}
return(0);
}
//+------------------------------------------------------------------+안녕하세요 프로그래머, 저는 stepMA 평균 공식으로 가격 막대를 그리는 지표를 만들려고 합니다. 엘리트 지표이기 때문에 여기에 넣을 수 있는지 확신할 수 없었지만 iCustom 함수를 사용하여 해당 지표의 MTF 버전을 생성했기 때문에 제 코드에는 원래 공식의 흔적이 없습니다.
컴파일러에서 오류가 전혀 발생하지 않지만 표시기가 제대로 작동하지 않습니다. 버퍼를 엉망으로 만든 것 같습니다. 당신이 나를 도울 수?
미리 감사드립니다.
내 코드는 다음과 같습니다.
#property copyright "mladen"
#property link "www.forex-tsd.com"
//------------------------------------------------------------------
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 DarkGreen
#property indicator_width1 1
#property indicator_color2 FireBrick
#property indicator_width2 1
#property indicator_color3 LimeGreen
#property indicator_width3 2
#property indicator_color4 Orange
#property indicator_width4 2
//
//
//
extern int TimeFrame = 0; // Timeframe
extern int MaLength = 10; // Ma Length
extern int MaMethod = 18; // Ma method
extern double Sensitivity = 3; // Sensivity Factor
extern double StepSize = 3; // Constant Step Size
extern int Shift = 0; // OShify
extern bool HighLow = false; // High/Low Mode Switch (more sensitive)
extern color WickBuyColor = DarkGreen;
extern color WickSellColor = FireBrick;
extern color BodyBuyColor = LimeGreen;
extern color BodySellColor = Orange;
extern int WickWidth = 1;
extern int BodyWidth = 2;
extern bool alertsOn = false;
extern bool alertsOnCurrent = false;
extern bool alertsMessage = false;
extern bool alertsNotification = false;
extern bool alertsSound = false;
extern bool alertsEmail = false;
extern string MaMethods = "";
extern string __0 = "SMA";
extern string __1 = "EMA";
extern string __2 = "Double smoothed EMA";
extern string __3 = "Double EMA (DEMA)";
extern string __4 = "Triple EMA (TEMA)";
extern string __5 = "Smoothed MA";
extern string __6 = "Linear weighted MA";
extern string __7 = "Parabolic weighted MA";
extern string __8 = "Alexander MA";
extern string __9 = "Volume weghted MA";
extern string __10 = "Hull MA";
extern string __11 = "Triangular MA";
extern string __12 = "Sine weighted MA";
extern string __13 = "Linear regression";
extern string __14 = "IE/2";
extern string __15 = "NonLag MA";
extern string __16 = "Zero lag EMA";
extern string __17 = "Leader EMA";
extern string __18 = "Super smoother";
extern string __19 = "Smoother";
//
//
//
double MABuffer[];
double UpBuffer[];
double DnBuffer[];
double UpbBuffer[];
double DnbBuffer[];
double slope[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(6);
SetIndexBuffer(0,UpBuffer); SetIndexStyle(0,DRAW_HISTOGRAM, EMPTY, WickWidth, WickBuyColor);
SetIndexBuffer(1,DnBuffer); SetIndexStyle(1,DRAW_HISTOGRAM, EMPTY, WickWidth, WickSellColor);
SetIndexBuffer(2,UpbBuffer); SetIndexStyle(2,DRAW_HISTOGRAM, EMPTY, BodyWidth, BodyBuyColor);
SetIndexBuffer(3,DnbBuffer); SetIndexStyle(3,DRAW_HISTOGRAM, EMPTY, BodyWidth, BodySellColor);
SetIndexBuffer(4,MABuffer);
SetIndexBuffer(5,slope);
IndicatorShortName("StepMA averages MTF candles("+MaLength+","+Sensitivity+","+StepSize+")");
MaLength = MathMax(MaLength,1);
switch(TimeFrame)
{
case 1 : string TimeFrameStr="Period_M1"; break;
case 5 : TimeFrameStr="Period_M5"; break;
case 15 : TimeFrameStr="Period_M15"; break;
case 30 : TimeFrameStr="Period_M30"; break;
case 60 : TimeFrameStr="Period_H1"; break;
case 240 : TimeFrameStr="Period_H4"; break;
case 1440 : TimeFrameStr="Period_D1"; break;
case 10080 : TimeFrameStr="Period_W1"; break;
case 43200 : TimeFrameStr="Period_MN1"; break;
default : TimeFrameStr="Current Timeframe";
}
IndicatorShortName("StepMA averages MTF candles ("+TimeFrameStr+")");
return(0);
}
//----
//+------------------------------------------------------------------+
//| MTF function |
//+------------------------------------------------------------------+
int start()
{
datetime TimeArray[];
int i,limit,y=0,counted_bars=IndicatorCounted();
// Plot defined time frame on to current time frame
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);
limit= MathMin(Bars-counted_bars+3*TimeFrame/Period(),Bars-1);
for(i=0,y=0;i<limit;i++)
{
if (Time<TimeArray[y]) y++;
/*********************************************************************************************************
Add your main indicator loop below. You can reference an existing indicator with its iName or iCustom.
Rule 1: Add extern inputs above for all neccesary values
Rule 2: Use 'TimeFrame' for the indicator time frame
Rule 3: Use 'y' for your indicator's shift value
********************************************************************************************************/
MABuffer=iCustom(Symbol(),TimeFrame,"StepMA averages",MaLength,MaMethod,Sensitivity,StepSize,Shift,HighLow,0,y);
slope = slope;
if (MABuffer>MABuffer) slope = 1;
if (MABuffer<MABuffer) slope = -1;
if (slope == 1) { UpBuffer=High; DnBuffer=Low; UpbBuffer = MathMax(Open,Close); DnbBuffer = MathMin(Open,Close); }
if (slope == -1) { DnBuffer=High; UpBuffer=Low; DnbBuffer = MathMax(Open,Close); UpbBuffer = MathMin(Open,Close); }
}
return(0);
}
//+------------------------------------------------------------------+더 엑스프로
필요한 것은 슬로프 버퍼를 호출하는 것뿐입니다(나머지 모두 무시할 수 있음)
반환된 기울기가 1이면 상승 추세입니다.
반환된 기울기가 -1이면 하락 추세입니다.
안녕하세요 프로그래머, 저는 stepMA 평균 공식으로 가격 막대를 그리는 지표를 만들려고 합니다. 엘리트 지표이기 때문에 여기에 넣을 수 있는지 확신할 수 없었지만 iCustom 함수를 사용하여 해당 지표의 MTF 버전을 생성했기 때문에 제 코드에는 원래 공식의 흔적이 없습니다.
컴파일러에서 오류가 전혀 발생하지 않지만 표시기가 제대로 작동하지 않습니다. 버퍼를 엉망으로 만든 것 같습니다. 당신이 나를 도울 수?
미리 감사드립니다.
이와 같이 :
#property copyright "mladen"
#property link "www.forex-tsd.com"
//------------------------------------------------------------------
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 DarkGreen
#property indicator_width1 1
#property indicator_color2 FireBrick
#property indicator_width2 1
#property indicator_color3 LimeGreen
#property indicator_width3 2
#property indicator_color4 Orange
#property indicator_width4 2
//
//
//
extern int TimeFrame = 0; // Timeframe
extern int MaLength = 10; // Ma Length
extern int MaMethod = 18; // Ma method
extern double Sensitivity = 3; // Sensivity Factor
extern double StepSize = 3; // Constant Step Size
extern int Shift = 0; // OShify
extern bool HighLow = false; // High/Low Mode Switch (more sensitive)
extern color WickBuyColor = DarkGreen;
extern color WickSellColor = FireBrick;
extern color BodyBuyColor = LimeGreen;
extern color BodySellColor = Orange;
extern int WickWidth = 1;
extern int BodyWidth = 2;
extern bool alertsOn = false;
extern bool alertsOnCurrent = false;
extern bool alertsMessage = false;
extern bool alertsNotification = false;
extern bool alertsSound = false;
extern bool alertsEmail = false;
extern string MaMethods = "";
extern string __0 = "SMA";
extern string __1 = "EMA";
extern string __2 = "Double smoothed EMA";
extern string __3 = "Double EMA (DEMA)";
extern string __4 = "Triple EMA (TEMA)";
extern string __5 = "Smoothed MA";
extern string __6 = "Linear weighted MA";
extern string __7 = "Parabolic weighted MA";
extern string __8 = "Alexander MA";
extern string __9 = "Volume weghted MA";
extern string __10 = "Hull MA";
extern string __11 = "Triangular MA";
extern string __12 = "Sine weighted MA";
extern string __13 = "Linear regression";
extern string __14 = "IE/2";
extern string __15 = "NonLag MA";
extern string __16 = "Zero lag EMA";
extern string __17 = "Leader EMA";
extern string __18 = "Super smoother";
extern string __19 = "Smoother";
//
//
//
double UpBuffer[];
double DnBuffer[];
double UpbBuffer[];
double DnbBuffer[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0,UpBuffer); SetIndexStyle(0,DRAW_HISTOGRAM, EMPTY, WickWidth, WickBuyColor);
SetIndexBuffer(1,DnBuffer); SetIndexStyle(1,DRAW_HISTOGRAM, EMPTY, WickWidth, WickSellColor);
SetIndexBuffer(2,UpbBuffer); SetIndexStyle(2,DRAW_HISTOGRAM, EMPTY, BodyWidth, BodyBuyColor);
SetIndexBuffer(3,DnbBuffer); SetIndexStyle(3,DRAW_HISTOGRAM, EMPTY, BodyWidth, BodySellColor);
IndicatorShortName("StepMA averages MTF candles("+MaLength+","+Sensitivity+","+StepSize+")");
MaLength = MathMax(MaLength,1);
switch(TimeFrame)
{
case 1 : string TimeFrameStr="Period_M1"; break;
case 5 : TimeFrameStr="Period_M5"; break;
case 15 : TimeFrameStr="Period_M15"; break;
case 30 : TimeFrameStr="Period_M30"; break;
case 60 : TimeFrameStr="Period_H1"; break;
case 240 : TimeFrameStr="Period_H4"; break;
case 1440 : TimeFrameStr="Period_D1"; break;
case 10080 : TimeFrameStr="Period_W1"; break;
case 43200 : TimeFrameStr="Period_MN1"; break;
default : TimeFrameStr="Current Timeframe";
}
IndicatorShortName("StepMA averages MTF candles ("+TimeFrameStr+")");
return(0);
}
//----
//+------------------------------------------------------------------+
//| MTF function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit = MathMin(MathMax(Bars-counted_bars,3*TimeFrame/Period()),Bars-1);
for(int i=limit;i>=0;i--)
{
int y = iBarShift(NULL,TimeFrame,Time);
int slope=iCustom(Symbol(),TimeFrame,"StepMA averages",MaLength,MaMethod,Sensitivity,StepSize,Shift,HighLow,5,y);
if (slope == 1) { UpBuffer=High; DnBuffer=Low; UpbBuffer = MathMax(Open,Close); DnbBuffer = MathMin(Open,Close); }
if (slope == -1) { DnBuffer=High; UpBuffer=Low; DnbBuffer = MathMax(Open,Close); UpbBuffer = MathMin(Open,Close); }
}
return(0);
}
//+------------------------------------------------------------------+
그런 다음 동일한 매개 변수 를 사용하면 동일하게 됩니다.
이와 같이 :
#property copyright "mladen"
#property link "www.forex-tsd.com"
//------------------------------------------------------------------
#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 DarkGreen
#property indicator_width1 1
#property indicator_color2 FireBrick
#property indicator_width2 1
#property indicator_color3 LimeGreen
#property indicator_width3 2
#property indicator_color4 Orange
#property indicator_width4 2
//
//
//
extern int TimeFrame = 0; // Timeframe
extern int MaLength = 10; // Ma Length
extern int MaMethod = 18; // Ma method
extern double Sensitivity = 3; // Sensivity Factor
extern double StepSize = 3; // Constant Step Size
extern int Shift = 0; // OShify
extern bool HighLow = false; // High/Low Mode Switch (more sensitive)
extern color WickBuyColor = DarkGreen;
extern color WickSellColor = FireBrick;
extern color BodyBuyColor = LimeGreen;
extern color BodySellColor = Orange;
extern int WickWidth = 1;
extern int BodyWidth = 2;
extern bool alertsOn = false;
extern bool alertsOnCurrent = false;
extern bool alertsMessage = false;
extern bool alertsNotification = false;
extern bool alertsSound = false;
extern bool alertsEmail = false;
extern string MaMethods = "";
extern string __0 = "SMA";
extern string __1 = "EMA";
extern string __2 = "Double smoothed EMA";
extern string __3 = "Double EMA (DEMA)";
extern string __4 = "Triple EMA (TEMA)";
extern string __5 = "Smoothed MA";
extern string __6 = "Linear weighted MA";
extern string __7 = "Parabolic weighted MA";
extern string __8 = "Alexander MA";
extern string __9 = "Volume weghted MA";
extern string __10 = "Hull MA";
extern string __11 = "Triangular MA";
extern string __12 = "Sine weighted MA";
extern string __13 = "Linear regression";
extern string __14 = "IE/2";
extern string __15 = "NonLag MA";
extern string __16 = "Zero lag EMA";
extern string __17 = "Leader EMA";
extern string __18 = "Super smoother";
extern string __19 = "Smoother";
//
//
//
double UpBuffer[];
double DnBuffer[];
double UpbBuffer[];
double DnbBuffer[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0,UpBuffer); SetIndexStyle(0,DRAW_HISTOGRAM, EMPTY, WickWidth, WickBuyColor);
SetIndexBuffer(1,DnBuffer); SetIndexStyle(1,DRAW_HISTOGRAM, EMPTY, WickWidth, WickSellColor);
SetIndexBuffer(2,UpbBuffer); SetIndexStyle(2,DRAW_HISTOGRAM, EMPTY, BodyWidth, BodyBuyColor);
SetIndexBuffer(3,DnbBuffer); SetIndexStyle(3,DRAW_HISTOGRAM, EMPTY, BodyWidth, BodySellColor);
IndicatorShortName("StepMA averages MTF candles("+MaLength+","+Sensitivity+","+StepSize+")");
MaLength = MathMax(MaLength,1);
switch(TimeFrame)
{
case 1 : string TimeFrameStr="Period_M1"; break;
case 5 : TimeFrameStr="Period_M5"; break;
case 15 : TimeFrameStr="Period_M15"; break;
case 30 : TimeFrameStr="Period_M30"; break;
case 60 : TimeFrameStr="Period_H1"; break;
case 240 : TimeFrameStr="Period_H4"; break;
case 1440 : TimeFrameStr="Period_D1"; break;
case 10080 : TimeFrameStr="Period_W1"; break;
case 43200 : TimeFrameStr="Period_MN1"; break;
default : TimeFrameStr="Current Timeframe";
}
IndicatorShortName("StepMA averages MTF candles ("+TimeFrameStr+")");
return(0);
}
//----
//+------------------------------------------------------------------+
//| MTF function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
int limit = MathMin(MathMax(Bars-counted_bars,3*TimeFrame/Period()),Bars-1);
for(int i=limit;i>=0;i--)
{
int y = iBarShift(NULL,TimeFrame,Time);
int slope=iCustom(Symbol(),TimeFrame,"StepMA averages",MaLength,MaMethod,Sensitivity,StepSize,Shift,HighLow,5,y);
if (slope == 1) { UpBuffer=High; DnBuffer=Low; UpbBuffer = MathMax(Open,Close); DnbBuffer = MathMin(Open,Close); }
if (slope == -1) { DnBuffer=High; UpBuffer=Low; DnbBuffer = MathMax(Open,Close); UpbBuffer = MathMin(Open,Close); }
}
return(0);
}
//+------------------------------------------------------------------+
[/PHP]
And then with same parameters they are going to be the same :네 감사합니다.
Mladen, 이 언어를 진지하게 배우기 위한 자료를 어디서 구할 수 있는지 아십니까?
이 유형의 코드에 대한 질문입니다.
[PHP]만약 (MABuffer>MABuffer) 기울기 = 1;이는 다음을 의미합니다. (현재 막대의 MABuffer[현재 막대의]>MA 버퍼[현재 막대의 + 1이므로 다음 막대의]) 기울기[현재 막대의]가 1과 같으면;
옳은?
네 감사합니다.
Mladen, 이 언어를 진지하게 배우기 위한 자료를 어디서 구할 수 있는지 아십니까?
이 유형의 코드에 대한 질문입니다.
의미: (MABuffer[현재 막대의]>MA 버퍼[현재 막대의 + 1이므로 다음 막대]의 기울기[현재 막대]가 1과 같으면;
옳은?네. 아마도 약간만 바꾸어 말하면: 만약 현재 ma > 이전 ma then slope = 1
학습 : 가장 좋은 곳은 https://www.mql5.com/en/forum/172969/page2 이 게시물로 시작하는 것입니다. (물론 묻습니다. 묻지 않고 배운 사람은 없습니다)
요구 !
나는 아주 간단한 EA를 원합니다.
- 하나의 EA는 2개의 양초가 같은 방향으로 닫히고 같은 양초의 끝에서 닫는 경우에만 거래를 엽니다.
더 설명 .. 알았어 ? .... 녹색으로 마감된 2개의 양초가 있는 경우 매수 거래를 엽니다. 내가 연 이 거래는 동일한 양초의 끝에서 닫히므로 2개의 빨간색이 닫힌 후 매도 거래가 열립니다. 양초 ........... 그래서 이것은 단 하나의 쉬운 제한입니다.
안녕,
icustom을 사용하여 MTF에서 일부 표시기를 돌리는 데 재미를 느끼고 있습니다. 표시기는 작동하지만 색상과 화살표가 제대로 표시되지 않습니다. 그 이유는 무엇입니까?
어디 오류가 있습니까?
wilders_trailing_stop_mtf.mq4
wilders_trailing_stop.mq4
#property copyright "thefxpros"
#property link "thefxpros@katamail.com"
//------------------------------------------------------------------
#property indicator_chart_window
//#property indicator_color1 Orange
//#property indicator_color2 LimeGreen
//#property indicator_color3 LimeGreen
//#property indicator_color4 Orange
//#property indicator_width3 1
//#property indicator_width4 1
//
//
//
extern int TimeFrame = 0;
extern int Length = 2;
extern double Coeff = 1.75;
extern int LineWidth = 1;
extern int ArrowWidth = 1;
extern color UpLineClr = LimeGreen;
extern color DnLineClr = Orange;
extern color UpArrowClr = LimeGreen;
extern color DnArrowClr = Orange;
//
double WTS[];
double WTSDn[];
double arrUp[];
double arrDn[];
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(4);
SetIndexBuffer(0,WTS); SetIndexStyle(0,DRAW_LINE, EMPTY, LineWidth, DnLineClr);
SetIndexBuffer(1,WTSDn); SetIndexStyle(1,DRAW_LINE, EMPTY, LineWidth, UpLineClr);
SetIndexBuffer(2,arrUp); SetIndexStyle(2,DRAW_ARROW, EMPTY, ArrowWidth, UpArrowClr); SetIndexArrow(2,SYMBOL_ARROWUP);
SetIndexBuffer(3,arrDn); SetIndexStyle(3,DRAW_ARROW, EMPTY, ArrowWidth, DnArrowClr); SetIndexArrow(3,SYMBOL_ARROWDOWN);
IndicatorShortName("Wilders trailing stop MTF ("+Length+","+Coeff+")");
Length = MathMax(Length,1);
switch(TimeFrame)
{
case 1 : string TimeFrameStr="Period_M1"; break;
case 5 : TimeFrameStr="Period_M5"; break;
case 15 : TimeFrameStr="Period_M15"; break;
case 30 : TimeFrameStr="Period_M30"; break;
case 60 : TimeFrameStr="Period_H1"; break;
case 240 : TimeFrameStr="Period_H4"; break;
case 1440 : TimeFrameStr="Period_D1"; break;
case 10080 : TimeFrameStr="Period_W1"; break;
case 43200 : TimeFrameStr="Period_MN1"; break;
default : TimeFrameStr="Current Timeframe";
}
IndicatorShortName("Wilders trailing stop MTF ("+TimeFrameStr+")");
return(0);
}
//----
//+------------------------------------------------------------------+
//| MTF function |
//+------------------------------------------------------------------+
int start()
{
datetime TimeArray[];
int i,limit,y=0,counted_bars=IndicatorCounted();
// Plot defined time frame on to current time frame
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);
limit= MathMin(Bars-counted_bars+3*TimeFrame/Period(),Bars-1);
for(i=0,y=0;i<limit;i++)
{
if (Time<TimeArray[y]) y++;
/*********************************************************************************************************
Add your main indicator loop below. You can reference an existing indicator with its iName or iCustom.
Rule 1: Add extern inputs above for all neccesary values
Rule 2: Use 'TimeFrame' for the indicator time frame
Rule 3: Use 'y' for your indicator's shift value
********************************************************************************************************/
WTS=iCustom(Symbol(),TimeFrame,"Wilders trailing stop",Length,Coeff,0,y);
WTSDn=iCustom(Symbol(),TimeFrame,"Wilders trailing stop",Length,Coeff,1,y);
arrUp=iCustom(Symbol(),TimeFrame,"Wilders trailing stop",Length,Coeff,2,y);
arrDn=iCustom(Symbol(),TimeFrame,"Wilders trailing stop",Length,Coeff,3,y);
}
return(0);
}
//+------------------------------------------------------------------+