See this script:
//+------------------------------------------------------------------+ //| ChartScroll.mq4 | //| Copyright © 2006, MetaQuotes Software Corp. | //| http://www.metaquotes.net | //+------------------------------------------------------------------+ #property copyright "Copyright © 2006, MetaQuotes Software Corp." #property link "http://www.metaquotes.net" #include <WinUser32.mqh> int MT4InternalMsg=0; datetime first_pos; int periods[5]={ PERIOD_M1,PERIOD_M5,PERIOD_M15,PERIOD_M30,PERIOD_H1 }; int handles[5]; int init() { //---- MT4InternalMsg = RegisterWindowMessageA("MetaTrader4_Internal_Message"); Print("Registered message ",MT4InternalMsg); first_pos=Time[FirstVisibleBar()]; //---- for(int i=0; i<5; i++) { if(periods[i]!=Period()) { handles[i]=WindowHandle(Symbol(),periods[i]); if(handles[i]==NULL) Print(Symbol(),",",periods[i]," not found"); } else handles[i]=NULL; } //---- return(0); } //+------------------------------------------------------------------+ //| script program start function | //+------------------------------------------------------------------+ int start() { datetime pos; //---- while(!IsStopped()) { pos=Time[FirstVisibleBar()]; if(first_pos!=pos) { first_pos=pos; for(int i=0; i<5; i++) { if(handles[i]!=NULL) PostMessageA(handles[i],MT4InternalMsg,55,first_pos+periods[i]*60); } } Sleep(100); } //---- return(0); } //+------------------------------------------------------------------+
from "MQL4: Визуализация тестирования. Расширение функциональности."
I'd like a "native" system which would behave like standard MT4, but would work on history data, some sort of Replay or Offline mode. With variable replay speed of course :).
A program called Forex Tester does this, but it too works on one chart at a time only (for now, they've promised multiple chart support in next major version).
Hi Rosh,
Could you please show us more information about MetaTrader4_Internal_Message ?
all of the Internel comments ? e.g, How can i get datetime when i press the mouse on the Chat ?
Could you please help me solving this topic : http://www.metatrader4.com
Thanks in advance.
Hi Rosh,
Could you please show us more information about MetaTrader4_Internal_Message ?
all of the Internel comments ? e.g, How can i get datetime when i press the mouse on the Chat ?
Could you please help me solving this topic : https://www.metatrader4.com/
Thanks in advance.
Try see there - https://www.mql5.com/en/code/8646
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'd like to make a suggestion regarding manual testing using MT. If other people are interested in manual testing please write your thoughts here so maybe the MT team will notice this request ;)
CURRENT implementation:
------------------------------
The user sets AutoScroll property to False and moves the chart back in time using the mouse. Then the user starts testing while using F12 to bring each future bar on the chart.
-- There are a couple of major DRAWBACKS in current implementation:
1. It is very easy to drag by mistake (with the mouse or a few keys like End) the chart back into the future and if the user can see what's next then the whole testing activity is destroyed.
2. The last bar it is always glued on the right side of the chart, near the scale numbers, thus it is impossible to read leading indicators like time cycles or trendlines.
PROPOSED implementation:
--------------------------------
This proposal tries to correct the above drawbacks by adding in MT a "true" manual testing capability. This capability is enabled by setting a property on the chart, like "Enable replay mode", and when enabled the chart cannot be moved in the future by dragging or anything, just like there is no data. A new bar in the future can be manually feed like in the current implementation, by pressing F12. Also if the property "Chart shift" is enabled then the last test bar will not be glued to the right side, just like a usual chart.
Thanks!
-soso