Does MQL5/MetaTrader have these capabilities?

 

I've posted some previous questions on the forum with no luck :-( So instead I've decided to ask some more general questions that may give me an idea of whether the capabilities of the MetaTrader/MQL5 platform provide what I ?think? I would like to do.

Does MQL5/MetaTrader have the capability to:-

  • Create an EA (Expert Advisor) that works in two or more time frames?
  • Can Indicators in an EA (ExpertAdvisor) be in different time frames and thus provide me with their behavioural information in different time frames?
  • Can the graphs and associated indicators working in a particular time frame be displayed together (my previous unanswered post was about this :-( https://www.mql5.com/en/forum/5846)... I don't seem to be able to get this to work.
  • Can there be more than one trade active at the same time (i.e. a short position and a long position running in different time frames).
Thanks in advance

TC 

 

  • Create an EA (Expert Advisor) that works in two or more time frames? Yes, you set the Period of the EA
  • Can Indicators in an EA (ExpertAdvisor) be in different time frames and thus provide me with their behavioural information in different time frames? Yes you set the Period of the indicator
  • Can the graphs and associated indicators working in a particular time frame be displayed together (my previous unanswered post was about this :-( https://www.mql5.com/en/forum/5846)... I don't seem to be able to get this to work. Yes use the Chart indicator Add funtion in you EA's init. Remeber to user ChartIndicator release in your deInit

    ChartIndicatorAdd

    Adds an indicator with the specified handle into a specified chart window.

  • Can there be more than one trade active at the same time (i.e. a short position and a long position running in different time frames). No, not in Metatrader 5. Hedging is not allowed. but think out of the box and it might be still possible :)

Hope this helps,

Tool,

 

I checked you previous post and I'm too lazy to read your code. I feel that might be the reason you didn't get a response. People are busy making money bru :) break the code up in simple parts...If you dont understand the code then there is a Job section where you can get it done there. :)


oh I wanted to mention, you can have even have two indicators on diffrent Sybols....EURUSB and GBPUSD.


Goodluck!

 
ToolMaker:

I checked you previous post and I'm too lazy to read your code. I feel that might be the reason you didn't get a response. People are busy making money bru :) break the code up in simple parts...If you dont understand the code then there is a Job section where you can get it done there. :)


oh I wanted to mention, you can have even have two indicators on diffrent Sybols....EURUSB and GBPUSD.


Goodluck!

Thanks for you advice and help :-)

Very much appreciated.

I sent you a message on your profile.

Do you pick these up?

 

I still can't get the charts to display.

I'm running it under the strategy tester.

I want graphs in two time frames. 3 minute and 15minutes.

I would like both graphs to be displayed each with its associated ADX indicator (for example).

The following code shows my attempt to open a new chart on a different time frame to that of the Strategy tester.

  long chartOpenHandle = ChartOpen("GBPUSD", PERIOD_M15);
  if (chartOpenHandle == 0)
  {
      Alert("Error Creating Handles for indicators - error: ",GetLastError(),"!!");
      return(-1); 
  }
I do this witin the OnInit() function. But no chart appears.
I even tried to add an indicator in the hope that things would come to life, but no luck. I used this code.
int adxHandle2=iADX(NULL,PERIOD_M15,15);

ChartIndicatorAdd(chartOpenHandle, 0, adxHandle2);

Why is this so hard :-(

	          
 

Hi Sorry appologies for not responding...not use to looking at my messages :)

 

I think it is because you doing a chart open... Most of the time your chart will already be created fro you, The tester creates one and when you drag your bot onto a chart you already have a shart, not sure if this will help but I use 0 (current chart for the id). Another thing I think is a problem. The ADX is not surpose to run in the main window but in a sub window. So use 1 for subwindows parameter.

 So drop the Chart open and just keep the second block code like this:

 int adxHandle2=iADX(NULL,PERIOD_M15,15);

ChartIndicatorAdd(0, 1, adxHandle2);

 Just to make sure I understand what you want to do:

1) You dont want to manualy add the ADX, you want the ADX to appear when you drag your bot on the chart?

2) You mentioned the strat tester? you want your indicator to display while the strat tester run? if so, do you have visuallization enabled? 

  

you seem to catch me everyttime I need to go to work :) I wil look at your messages next time :) goodluck. 

Documentation on MQL5: Chart Operations / ChartIndicatorAdd
  • www.mql5.com
Chart Operations / ChartIndicatorAdd - Documentation on MQL5