Download MetaTrader 5
To add comments, please log in or register
How to earn at MQL5.community? Come and find out!
Subgenius
572
Subgenius 2014.04.19 08:34 

I have a custom indicator to call in the symbols values for two timeframes and I have run through strategy tester and

for labels printing the chosen timeframe they update but for those from a differnt timeframe they never change.

Is there limitation? MT4 b625 Meta Editor 5 b914

---

Another thing that does not show on text-label is showing spread.

SYED NAUFAL GADDAFI
1401
SYED NAUFAL GADDAFI 2014.04.19 11:33  
Show us your code for people to see and check what is wrong with it.
Subgenius
572
Subgenius 2014.04.20 02:27  
deysmacro:
Show us your code for people to see and check what is wrong with it.

Sure, try this ea in tester and you see this. How can MTF work in strategy tester?





//+------------------------------------------------------------------+
//|                                                     mtf test.mq4 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
string Signal;

void OnTick()
  {
   double MA10fast=iMA(NULL,15,10,0,0,0,0);
   double MA20fast=iMA(NULL,15,20,0,0,0,0);
   double MA10slow=iMA(NULL,30,10,0,0,0,0);
   double MA20slow=iMA(NULL,30,20,0,0,0,0);
   TextLabel("TextLabel_1","[m15]","Arial",Yellow,10,100,45,1);
   TextLabel("TextLabel_2","[m30]","Arial",Yellow,10,50,43,1);
   TextLabel("TextLabel_3","[iMA10]","Arial",Yellow,10,150,75,1);
   TextLabel("TextLabel_4","[iMA20]","Arial",Yellow,10,150,99,1);
   TextLabel("TextLabel_5",DoubleToString(MA10fast,Digits),"Arial",Yellow,10,100,74,1); //ima10 m15
   TextLabel("TextLabel_6",DoubleToString(MA20fast,Digits),"Arial",Yellow,10,100,98,1); //ima10 m15
   TextLabel("TextLabel_7",DoubleToString(MA10slow,Digits),"Arial",Yellow,10,50,73,1); //ima20 m30
   TextLabel("TextLabel_8",DoubleToString(MA20slow,Digits),"Arial",Yellow,10,50,98,1); //ima30 m30
   if(MA10fast>=iHigh(NULL,15,0) && MA20fast>=iHigh(NULL,15,0) &&
      MA10slow>=iHigh(NULL,30,0) && MA20slow>=iHigh(NULL,30,0)){Signal="Buy";}
   if(MA10fast<=iLow(NULL,15,0) && MA20fast<=iLow(NULL,15,0) &&
      MA10slow<=iLow(NULL,30,0) && MA20slow<=iLow(NULL,30,0)){Signal="Sell";}
   TextLabel("TextLabel_9",Signal,"Arial",Yellow,20,50,120,1);
  }
void TextLabel(string Name, string FontText, string Font, color FontColor, int FontSize, int x, int y, int z)
   {
   ObjectCreate(Name,OBJ_LABEL,0,0,0);
   ObjectSetText(Name,FontText,FontSize,Font,FontColor);
   ObjectSet(Name,OBJPROP_BACK,false);      
   ObjectSet(Name,OBJPROP_CORNER,z); //Upper left=0, Upper right=1, Lower left=2, Lower right=3   
   ObjectSet(Name,OBJPROP_XDISTANCE,x);
   ObjectSet(Name,OBJPROP_YDISTANCE,y);
   }
Files:
Alain Verleyen
Moderator
28652
Alain Verleyen 2014.04.20 20:40  
Subgenius:

Sure, try this ea in tester and you see this. How can MTF work in strategy tester?

You don't have (enough) M15 data.


/
To add comments, please log in or register