다중 기간 표시기 - 페이지 405

 

기간 TDI 병합

얘들아, 믈라덴

여러분 중 일부는 신호 제공자 로 TDI를 사용하므로 아래와 같이 TDI 경보 시스템을 발견했습니다(TDI에서 교차가 발생할 때 신호 또는 이메일 경보를 제공합니다). 아마도 이것은 새로운 것이 아닙니다. TDI를 최소 두 개의 시간 프레임(기본 60분, 스캘핑의 경우 5분)으로 거래하는 것이 더 안전하므로 다음이 가능한지 묻고 있습니다. 내가 원하는 것은 적어도 두 개의 서로 다른 시간 프레임의 신호를 병합하여 전체를 제공하는 것입니다. 더 신뢰할 수 있는 신호: 더 큰 시간 프레임이 기준으로 사용되며 위 또는 아래는 더 작은 시간 프레임에 대한 방향을 제공합니다. 더 작은 기간에 동일한 신호가 나타나면 거래입니다. 거래는 더 작은 시간 프레임에 따라 종료 신호에서만 종료됩니다.

여기 내가 신호 생성에 대해 말하는 지표가 있습니다. 여러분은 어떻게 생각하거나 이미 비슷한 것이 게시되었습니까?

 
Jonny473:
얘들아, 믈라덴

여러분 중 일부는 신호 제공자로 TDI를 사용하므로 아래와 같이 TDI 경보 시스템을 발견했습니다(TDI에서 교차가 발생할 때 신호 또는 이메일 경보를 제공합니다). 아마도 이것은 새로운 것이 아닙니다. TDI를 최소 두 개의 시간 프레임(기본 60분, 스캘핑의 경우 5분)으로 거래하는 것이 더 안전하므로 다음이 가능한지 묻고 있습니다. 내가 원하는 것은 적어도 두 개의 서로 다른 시간 프레임의 신호를 병합하여 전체를 제공하는 것입니다. 더 신뢰할 수 있는 신호: 더 큰 시간 프레임이 기준으로 사용되며 위 또는 아래는 더 작은 시간 프레임에 대한 방향을 제공합니다. 더 작은 기간에 동일한 신호가 나타나면 거래입니다. 거래는 더 작은 시간 프레임에 따라 종료 신호에서만 종료됩니다.

여기 내가 신호 생성에 대해 말하는 지표가 있습니다. 여러분은 어떻게 생각하거나 이미 비슷한 것이 게시되었습니까?

잠시 후 표시기를 게시합니다...

 
mladen:
FxTrendsTrader 여기 있습니다

친애하는 믈라덴

이 표시기에 '경사에 채색'을 추가할 수 있습니까?

미리 감사드립니다

비밀 코드

 
Jonny473:
잠시 후 표시기를 게시합니다...

심장마비....?...

 
fxnewbie:
심장마비....?...

아니요 심장 마비가 아닙니다. 코드가 있습니다. 복사하여 표시기를 만들고 파일을 찾을 수 없습니다.

/*------------------------------------------------ ------------------------------------

이름: xTDI-Arrow.mq4

Copyright ?2010, Xaphod, Forex Whiz

설명: - TDI 십자가에 대한 화살표를 그립니다.

- 위의 세 라인의 교차에 대한 경고를 제공합니다.

변경 로그:

2010-10-19. 자포드, v1.00

- 초판

-------------------------------------------------- -----------------------------------*/

// 표시기 속성

#property copyright "Copyright ? 2010, Xaphod"

#속성 링크 "http://forexwhiz.appspot.com"

#속성 표시기_차트_창

#속성 표시기_버퍼 4

#property indicator_color1 라임그린

#property indicator_color2 빨간색

#property indicator_color3 녹색

#property indicator_color4 FireBrick

#속성 표시기_너비1 1

#속성 표시기_너비2 1

#속성 표시기_너비3 1

#속성 표시기_너비4 1

#속성 표시기_최대 1

#속성 표시기_최소 0

// 상수 정의

#define INDICATOR_NAME "xTDI-화살표"

#define INDICATOR_VERSION "v1.00"

#define BAR_HEIGHT 1.00

#define TDI_INDI "Traders_Dynamic_Index"

#define ARROW_THIN_UP 225

#define ARROW_THIN_DN 226

#define ARROW_THICK_UP 233

#define ARROW_THICK_DN 234

#define ARROW_HOLLOW_UP 241

#define ARROW_HOLLOW_DN 242

#define ARROW_ROUND_UP 221

#define ARROW_ROUND_DN 222

// 표시 매개변수

extern string Indi.Copyright= "?2010, forexwhiz.appspot.com";

외부 문자열 Indi.Version= INDICATOR_VERSION;

외부 문자열 Show.Settings="????????????????????????????????????????";

extern int Show.TimeFrame=0; // 사용할 기간. 현재 시간대=0.

extern bool Show.MarketBaseLine=true; // 다른 색상으로 시장 기준선 위/아래 교차 표시

extern int Show.ArrowType=0; // 0=얇음, 1=두꺼움, 2=중공, 3=둥근

extern int Show.ArrowSize=1; // 화살표 크기(1-5)

extern int Show.ArrowOffset=10; // 화살표를 표시하기 위해 촛불의 끝에서 오프셋

외부 문자열 TDI.Settings="????????????????????????????????????????";

extern int TDI.RSIPeriod = 13; // 기간. 권장 값: 8-25

외부 정수 TDI.RSIPrice = 0; // 0=닫힘, 1=열림, 2=높음, 3=낮음, 4=중간값, 5=일반, 6=가중치

extern int TDI.VolatilityBand = 34; // 권장 값: 20-40

외부 정수 TDI.RSIPriceLine = 2; // 기간

외부 정수 TDI.RSIPriceType = 0; // 0=SMA, 1=EMA, 2=SSMA, 3=LWMA

외부 정수 TDI.TradeSignalLine = 7; // 기간

외부 정수 TDI.TradeSignalType = 0; // 0=SMA, 1=EMA, 2=SSMA, 3=LWMA

외부 문자열 Alert.Settings="????????????????????????????????????????";

extern bool Alert.RSIPriceLine=true; // RSI 가격이 시그널 라인을 넘으면 경고합니다. 녹색은 빨간색을 교차합니다.

extern 부울 Alert.MarketBaseLine=true; // RSI 가격이 신호선과 시장 기준선을 교차하면 경고합니다. 녹색은 빨간색과 노란색을 교차합니다.

extern 부울 Alert.NewBarOnly=true; // True=새 막대가 열리면 경고합니다. False=선이 교차할 때마다 경고

외부 int Alert.Timeout=60; // 경고 후 N초 동안 경고를 비활성화합니다. Alert.NewBarOnly=false인 경우에만

extern bool Alert.Popup=true; // 팝업 창 및 경고음 발생

외부 부울 Alert.Email=거짓; // 경고 시 이메일 보내기

// 전역 모듈 변수

이중 dBuffer0[];

이중 dBuffer1[];

이중 dBuffer2[];

이중 dBuffer3[];

bool bStartup;

무효 SetArrowType(int& iArrowUp, int& iArrowDn) {

스위치(Show.ArrowType) {

사례 1: // 얇은

iArrowDn=ARROW_THIN_DN;

iArrowUp=ARROW_THIN_UP;

부서지다;

사례 2: // 속이 빈

iArrowDn=ARROW_HOLLOW_DN;

iArrowUp=ARROW_HOLLOW_UP;

부서지다;

사례 3: // 라운드

iArrowDn=ARROW_ROUND_DN;

iArrowUp=ARROW_ROUND_UP;

부서지다;

기본값: // 두꺼운

iArrowDn=ARROW_THICK_DN;

iArrowUp=ARROW_THICK_UP;

부서지다;

}

}

//------------------------------------------------ --------------------------

// 함수: 초기화()

// 설명: 커스텀 인디케이터 초기화 함수.

//------------------------------------------------ --------------------------

정수 초기화() {

int iArrowUp;

int iArrowDn;

문자열 sType;

문자열 sTF;

SetArrowType(iArrowUp, iArrowDn);

SetIndexStyle(0,DRAW_ARROW,EMPTY,Show.ArrowSize);

SetIndexBuffer(0,dBuffer0);

SetIndexLabel(0,"TDI:Mkt-Up");

SetIndexArrow(0, iArrowUp);

SetIndexStyle(1,DRAW_ARROW,EMPTY,Show.ArrowSize);

SetIndexBuffer(1,dBuffer1);

SetIndexLabel(1,"TDI:Mkt-Dn");

SetIndexArrow(1, iArrowDn);

SetIndexStyle(2,DRAW_ARROW,EMPTY,Show.ArrowSize);

SetIndexBuffer(2,dBuffer2);

SetIndexLabel(2,"TDI:가입");

SetIndexArrow(2, iArrowUp);

SetIndexStyle(3,DRAW_ARROW,EMPTY,Show.ArrowSize);

SetIndexBuffer(3,dBuffer3);

SetIndexLabel(3,"TDI:Sig-Dn");

SetIndexArrow(3, iArrowDn);

if (Show.TimeFrame==0)

sTF="";

또 다른

sTF=TF2Str(Show.TimeFrame);

IndicatorShortName(INDICATOR_NAME+" "+sTF);

b시작=참;

리턴(0);

}

//------------------------------------------------ --------------------------

// 함수: deinit()

// 설명: 커스텀 인디케이터 초기화 해제 기능.

//------------------------------------------------ --------------------------

정수 초기화() {

리턴(0);

}

///------------------------------------------------------------- ------------------------------

// 함수: 시작()

// 설명: 사용자 지정 표시기 반복 함수.

//------------------------------------------------ --------------------------

정수 시작() {

int iNewBars;

int iCountedBars;

정수 나;

이중 dVBHighLine; // 상단 변동성 밴드 - 상단 파란색 선

더블 dVBlowLine; // 낮은 변동성 밴드 - 낮은 파란색 선

더블 dMarketBaseLine0; // 시장 기준선 - 노란색 선

이중 dRSIPriceLine0; // RSI PriceLine - 녹색 선

이중 dTradeSignalLine0; // 무역 신호 라인 - 레드 라인

정적 이중 dMarketBaseLine1; // 시장 기준선 - 노란색 선

정적 이중 dRSIPriceLine1; // RSI PriceLine - 녹색 선

정적 이중 dTradeSignalLine1; // 무역 신호 라인 - 레드 라인

이중 dOffset;

// 처리되지 않은 틱 가져오기

iCountedBars=IndicatorCounted();

if(iCountedBars < 0) 반환(-1);

if(iCountedBars>0) iCountedBars--;

iNewBars=막대-iCountedBars;

for(i=iNewBars; i>=0; i--) {

// 이전 TDI 데이터 가져오기

//if (시간!=tCurTime) {

//tCurTime=시간;

 

dMarketBaseLine1=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,2,i+1); // 노란색 라인

dRSIPriceLine1=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,4,i+1); // 녹색 선

dTradeSignalLine1=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,5,i+1); // 레드 라인

//}

// 현재 TDI 데이터 가져오기

dMarketBaseLine0=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,2,i); // 노란색 라인

dRSIPriceLine0=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,4,i); // 녹색 선

dTradeSignalLine0=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,5,i); // 레드 라인

// 현재 디스플레이 버퍼 지우기

dBuffer0 = EMPTY_VALUE ;

dBuffer1 = EMPTY_VALUE;

dBuffer2 = EMPTY_VALUE;

dBuffer3 = EMPTY_VALUE;

dOffset=포인트*(10*Show.ArrowOffset/MarketInfo(Symbol(),MODE_TICKVALUE));

if (dRSIPriceLine0>dMarketBaseLine0 && dRSIPriceLine1dTradeSignalLine0 && Show.MarketBaseLine)

dBuffer0 = 낮은 dOffset;

else if (dRSIPriceLine0>dTradeSignalLine0 && dRSIPriceLine1<dTradeSignalLine1)

dBuffer2 = 낮은 dOffset;

if (dRSIPriceLine0dMarketBaseLine1 && dRSIPriceLine0<dTradeSignalLine0 && Show.MarketBaseLine)

dBuffer1 = 높음 + d오프셋;

그렇지 않으면 (dRSIPriceLine0dTradeSignalLine1)

dBuffer3 = 높음 + d오프셋;

// 경고 확인

if (i==0) AlertCheck();

}

// 시작 플래그 재설정

if (bStartup) bStartup=거짓;

// 안녕

리턴(0);

}

//+----------------------------------------------- -------------------+

//------------------------------------------------ --------------------------

// 함수: TF2Str()

// 설명: 시간 프레임을 문자열로 변환

//------------------------------------------------ --------------------------

문자열 TF2Str(int iPeriod) {

스위치(iPeriod) {

케이스 PERIOD_M1: return("M1");

케이스 PERIOD_M5: return("M5");

케이스 PERIOD_M15: return("M15");

케이스 PERIOD_M30: return("M30");

케이스 PERIOD_H1: return("H1");

케이스 PERIOD_H4: return("H4");

케이스 PERIOD_D1: return("D1");

케이스 PERIOD_W1: return("W1");

케이스 PERIOD_MN1: return("MN1");

기본값: return("M"+iPeriod);

}

}

//------------------------------------------------ --------------------------

// 함수: AlertCheck()

// 설명: 경고 조건 확인 및 경고 수행

//------------------------------------------------ --------------------------

무효 AlertCheck() {

문자열 sAlertMsg;

정적 날짜 시간 tCurTime=0;

정적 int iAlertTimer[2];

정적 int iAlertStatus[2];

이중 dMarketBaseLine[2]; // 시장 기준선 - 노란색 선

이중 dRSIPriceLine[2]; // RSI PriceLine - 녹색 선

이중 dTradeSignalLine[2]; // 무역 신호 라인 - 레드 라인

정수 i,j;

부울 bNewBar=거짓;

// 표시기가 막 시작된 경우 중단

if (bStartup) {

tCurTime=시간[0];

리턴(0);

}

// 경고 확인

if (Alert.RSIPriceLine || Alert.MarketBaseLine) {

// newbar만 있는 경우 경고

if (Alert.NewBarOnly) {

// 리셋 시간

if(tCurTime!=시간[0]) {

tCurTime=시간[0];

bNewBar=참;

// 새 막대(예: 막대 1 및 2)에서 TDI 데이터 가져오기

(i=0; i<2; i++) {

j=i+1;

dMarketBaseLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,2,j); // 노란색 라인

dRSIPriceLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,4,j); // 녹색 선

dTradeSignalLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,5,j); // 레드 라인

} // 종료

}//엔디프

}

또 다른 {

// 현재 막대, 즉 막대 0과 1에서 TDI 데이터를 가져옵니다.

(i=0; i<2; i++) {

dMarketBaseLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,2,i); // 노란색 라인

dRSIPriceLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,4,i); // 녹색 선

dTradeSignalLine=iCustom(NULL,Show.TimeFrame,TDI_INDI,TDI.RSIPeriod,TDI.RSIPrice,TDI.VolatilityBand,TDI.RSIPriceLine,

TDI.RSIPriceType,TDI.TradeSignalLine,TDI.TradeSignalType,5,i); // 레드 라인

} // 종료

} // 종료 if(Alert.NewBarOnly)

if (bNewBar || (!Alert.NewBarOnly && iAlertTimer[0]<GetTickCount())) {

//알림 RSIPriceLine > TradeSignalLine

if (dRSIPriceLine[0]>dTradeSignalLine[0] && dRSIPriceLine[1]<dTradeSignalLine[1] && Alert.RSIPriceLine) {

if (!Alert.NewBarOnly) iAlertTimer[0]=GetTickCount()+Alert.Timeout*1000;

sAlertMsg="TDI 경고 - "+Symbol()+" "+TF2Str(Period())+": TradeSignalLine 위의 RSIPriceLine.";

if (Alert.Popup) 경고(sAlertMsg);

if (Alert.Email) SendMail( sAlertMsg, "MT4 경고!\n" + TimeToStr(TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg);

} // 다음 경우 종료

//알림 RSIPriceLine < TradeSignalLine

if (dRSIPriceLine[0]dTradeSignalLine[1] && Alert.RSIPriceLine) {

//PrintD("RSIPriceLine < TradeSignalLine");

if (!Alert.NewBarOnly) iAlertTimer[0]=GetTickCount()+Alert.Timeout*1000;

sAlertMsg="TDI 경고 - "+Symbol()+" "+TF2Str(Period())+": TradeSignalLine 아래 RSIPriceLine.";

if (Alert.Popup) 경고(sAlertMsg);

if (Alert.Email) SendMail( sAlertMsg, "MT4 경고!\n" + TimeToStr(TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg);

} // 다음 경우 종료

} // 다음 경우 종료

if (bNewBar || (!Alert.NewBarOnly && iAlertTimer[1]<GetTickCount())) {

//RSIPriceLine > TradeSignalLine && dMarketBaseLine인 경우 경고

if (dRSIPriceLine[0]>dMarketBaseLine[0] && dRSIPriceLine[1]<dMarketBaseLine[1] && Alert.MarketBaseLine) {

if (dRSIPriceLine[0]>dTradeSignalLine[0] && dRSIPriceLine[1]<dTradeSignalLine[1]) {

if (!Alert.NewBarOnly) iAlertTimer[1]=GetTickCount()+Alert.Timeout*1000;

sAlertMsg="TDI 경고 - "+Symbol()+" "+TF2Str(Period())+": TradeSignalLine 및 MarketBaseLine 위의 RSIPriceLine.";

if (Alert.Popup) 경고(sAlertMsg);

if (Alert.Email) SendMail( sAlertMsg, "MT4 경고!\n" + TimeToStr(TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg);

} // 다음 경우 종료

} // 다음 경우 종료

//RSIPriceLine < TradeSignalLine && dMarketBaseLine인 경우 경고

if (dRSIPriceLine[0]dMarketBaseLine[1] && Alert.MarketBaseLine) {

if (dRSIPriceLine[0]dTradeSignalLine[1] ) {

if (!Alert.NewBarOnly) iAlertTimer[1]=GetTickCount()+Alert.Timeout*1000;

sAlertMsg="TDI 경고 - "+Symbol()+" "+TF2Str(Period())+": TradeSignalLine 및 MarketBaseLine 아래 RSIPriceLine.";

if (Alert.Popup) 경고(sAlertMsg);

if (Alert.Email) SendMail( sAlertMsg, "MT4 경고!\n" + TimeToStr(TIME_DATE|TIME_SECONDS )+"\n"+sAlertMsg);

} // 다음 경우 종료

} // 다음 경우 종료

} // 다음 경우 종료

}//end if(Alert.RSIPriceLine || Alert.MarketBaseLine)

반환(0);

}

경고: 10k 정책 때문에 코드를 두 부분으로 나눴습니다. 따라서 두 부분을 하나로 복사하고 표시기를 만드십시오!

 

좋아요 여러분, 모든 공식에 대해 죄송합니다!

파일:
tdi-2.mq4  4 kb
 

잘못된 것 방금 올바른 코드를 다른 코드에 복사하고, 이전 코드를 덮어쓰고, 컴파일했는데 파일이 여전히 이전 코드를 사용하고 있습니까?! 그것을 얻지 마십시오. 어쨌든 코드는 정확합니다

 
Jonny473:
잘못된 것 방금 올바른 코드를 다른 코드에 복사하고, 이전 코드를 덮어쓰고, 컴파일했는데 파일이 여전히 이전 코드를 사용하고 있습니까?! 그것을 얻지 마십시오. 어쨌든 코드는 정확합니다

예전에 올렸던 코드....

 

여기 내 오래된 랩톱에 Vista 버전이 있습니다. 이것이 mq4 파일이 계속 사라지는 이유입니다. 이제 작동해야합니다!

파일:
tdi-2.mq4  4 kb
사유: