https://igotit.tistory.com/2156
Custom Event 발생예제코드.
void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
{
switch(id)
{
case CHARTEVENT_KEYDOWN:
EventFire();
break;
}
}
// eventing to all charts except this chart.
void EventFire()
{
long currChart = ChartFirst();
int i=1;//1 for except current chart id =0
while(i<CHARTS_MAX)
{
EventChartCustom(currChart,1,0,0,0);
currChart=ChartNext(currChart);
if(currChart == -1) break;
i++;
}
}
다른 챠트에서 상기 이벤트 수신처리하는 부분.
void OnChartEvent(const int id,const long &lparam,const double &dparam,const string &sparam)
{
int id_event_custom;
if(id >= CHARTEVENT_CUSTOM && id <= CHARTEVENT_CUSTOM_LAST)
{
id_event_custom = id-CHARTEVENT_CUSTOM;
Print(id_event_custom);
switch(id_event_custom)
{
case 1:
Print("event from other chart");
break;
}
}
}
연관 상세 정보.
https://www.mql5.com/en/docs/eventfunctions/eventchartcustom
Documentation on MQL5: Working with Events / EventChartCustom
//+------------------------------------------------------------------+ //| ButtonClickExpert.mq5 | //| Copyright 2009, MetaQuotes Software Corp. | //|
www.mql5.com
https://www.mql5.com/en/forum/170560
Custom Event: Call from EA1 to EA2
Let's say in the same MT4 terminal there is one EA running on a EURUSD chart and one EA running on a GBPUSD chart...
www.mql5.com
https://www.mql5.com/en/forum/227307
https://www.mql5.com/en/forum/151368
How to extend the Event data
The custom event can carry only very tiny data...
www.mql5.com
https://www.mql5.com/en/forum/7576
question to MetaQuotes - event handling queue
Hello MetaQuotes, I am currently preparing a flexible framework for multicurrency EA for the ATC2012 and therefore I would like to ask for clarific...
www.mql5.com
https://www.mql5.com/en/articles/1163
MQL5 Cookbook: Handling Custom Chart Events
This article considers aspects of design and development of custom chart events system in the MQL5 environment. An example of an approach to the events classification can also be found here, as well as a program code for a class of events and a class of cu
www.mql5.com
본 글 포함된 상위 정리글 1. MQL5의 이벤트 : http://igotit.tistory.com/1817 의 OnChartEvent
|
첫등록 : 2019년 5월 11일
최종수정 :
본 글 단축주소 : https://igotit.tistory.com/2156
'트레이딩 > 메타트레이더 코딩' 카테고리의 다른 글
MQL5. struct. 구조체, DLL 함수인자에 구조체 전달 방법 (0) | 2019.05.16 |
---|---|
메타트레이더 . 코딩 . function pointer . 콜백 함수 (0) | 2019.05.13 |
MQL5. Custom Indicator (3) | 2019.05.10 |
MQL5. 소켓통신 (0) | 2019.05.09 |
MQL5. 수직선 그리기 (2) | 2019.04.29 |
댓글