hii , How do i get this code to refresh my chart indicators every 5 seconds or so?
and how does the (tools>options>charts>Max bars in chart) helps the system to diagnose the charts?, like.. is it helpful and what clearly does it do?
*EDIT: if you know what do i need to put as an indicator code for auto refreshing or just a code that i can add to my indicator that will do it please share thanks again.
thank you for you help!
and how does the (tools>options>charts>Max bars in chart) helps the system to diagnose the charts?, like.. is it helpful and what clearly does it do?
*EDIT: if you know what do i need to put as an indicator code for auto refreshing or just a code that i can add to my indicator that will do it please share thanks again.
thank you for you help!
Inserted Code
#property copyright "coded by Christian Jungen" #property link "[email protected]" #property indicator_chart_window #include <WinUser32.mqh> extern string spr = "---Refresh Period---"; extern string spr1 = "M1=1, M5=5, M15=15, M30=30"; extern string spr2 = "H1=60, H4=240, D1=1440, W1=10080"; extern int RefreshPeriod = 5; int hWindow = 0; int oldBars = 0; //+------------------------------------------------------------------+ //| indicator initialization function //+------------------------------------------------------------------+ int init() { hWindow = WindowHandle( Symbol(), Period() ); oldBars = iBars(NULL,RefreshPeriod); return (0); } //+------------------------------------------------------------------+ //| indicator start function //+------------------------------------------------------------------+ int start() { if ( oldBars < iBars(NULL,RefreshPeriod) && hWindow != 0 ) { int message; switch( Period() ) { case 1: message = 33137; break; case 5: message = 33138; break; case 15: message = 33139; break; case 30: message = 33140; break; case 60: message = 33135; break; case 240: message = 33136; break; case 1440: message = 33134; break; case 10080: message = 33141; break; default: message = 33137; // m1, if we can't identify current TF break; } PostMessageA( hWindow, WM_COMMAND, 33141, 0 ); // switch to weekly TF PostMessageA( hWindow, WM_COMMAND, message, 0 ); // switch to original TF oldBars = iBars(NULL,RefreshPeriod); } return (0); }