( If I right, you would like to say, do not use any code for that, is that right? )
Sorry did you try (/ test) it?
I mean if you tried that code that does not slow down your platform?
Specially while 'Order, Depth of Market' type of Expert Adivsors.
(I need to make similar like below picture)
Hope to hear from you soon.
Kind regards.
If someone can give advise me about that, do it, please.
I need any good advise about that.
Kind regards.
Big thanks for the information.
I am still researching about that, so I has been found 'Scripts Change Time Frame All.mq4' it works as quickly as possible.
(Posted - Change Time Frame All)
Is there any chance to write a good code for indicator won't "hang" anything?
After your answer I will decided, either I will continue my researching or not.
(Really I need your answer / advice.)
Kind regards.
Max-Enrik: Is there any chance to write a good code for indicator won't "hang" anything?
|
|
|
First of all thanks for the reply.
I do not sure I understand correctly or not, so I tried like below but I do not get any effects.
//+------------------------------------------------------------------+ //| Custom Indicator.mq4 | //| Copyright 2016, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2016, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict #property indicator_chart_window int lookback = 0; //string ChangeSP = "Where I go?"; string ChangeSP = Symbol(); //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int OnInit() { //--- ObjectCreate ( 0, ChangeSP, OBJ_BUTTON, 0, 0, 0 ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_XDISTANCE, 1600 ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_YDISTANCE, 200 ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_XSIZE, 200 ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_YSIZE, 40 ); ObjectSetString ( 0, ChangeSP, OBJPROP_TEXT, "Go to GBPUSD M15" ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_COLOR, White ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_BGCOLOR, Red ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_BORDER_COLOR, Red ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_BORDER_TYPE, BORDER_FLAT ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_BACK, false ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_HIDDEN, true ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_STATE, false ); ObjectSetInteger ( 0, ChangeSP, OBJPROP_FONTSIZE, 12 ); //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- // Print(ChangeSP); //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- ObjectsDeleteAll(0, ChangeSP); //---- return(0); } //+------------------------------------------------------------------+ //| ChartEvent function | //+------------------------------------------------------------------+ void OnChartEvent( const int id , const long & lparam , const double & dparam , const string & sparam ) { //--- if( sparam == ChangeSP ) { ChangeSPClick ( ChangeSP ); ObjectSetInteger( 0, ChangeSP, OBJPROP_STATE, false ); } return; } //+------------------------------------------------------------------+ void ChangeSPClick(bool ChartSetSymbolPeriod) { bool ChangeSP_action = ChartSetSymbolPeriod(0, "GBPUSD", 15 ); } //+------------------------------------------------------------------+ //| OnCalculate function | //+------------------------------------------------------------------+ int OnCalculate(const int rates_total , const int prev_calculated , const datetime &time[] , const double &open[] , const double &high[] , const double &low[] , const double &close[] , const long &tick_volume[] , const long &volume[] , const int &spread[] ) { for( int iBar = Bars - 1 - MathMax( lookback, prev_calculated ); iBar >= 0; --iBar ) { int ChangeSP_action = rates_total - 1 - MathMax( lookback, prev_calculated); int iLast = MathMax( 0, ChangeSP_action - 1 ); } return rates_total - 1; } //+------------------------------------------------------------------+
I need your good reply and advice, please.
Thanks.
Clear up yor code. You are mixing start ( ) and OnCalculate ( ).
Check the value of ChangeSP.
Thanks for the reply, and I already cleaned up below code.
Right now I have not any warnings.
int start() { //---- // Print(ChangeSP); //---- return(0); }
But still I do not got any effects.
Still I need good reply, please.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I try to use 'ChartSetSymbolPeriod' for my indicator, but this indicator slow down my MT4 platform when I try to use it with another Expert Advisors.
Please help me.