You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
This article is a help.
Change double iFractals(string symbol, int timeframe, int mode, int shift) in four to
I have little experience with MQL5 so far, I have reviewed the MQL5 Timeframe Guide but did not find anything useful.
I have a problem: I have a fractal indicator that works on one timeframe and I want to get its data on 2 different timeframes.
I have it like this:
#include <GetIndicatorBuffers.mqh>
int Fractals_handle; // pointer to the iFractals indicator
string period; // variable for different timeframes of the chart
void OnTick()
{
//---- indicator buffers for B. Williams' Fractals
static double Upper[]; // array for UPPER_LINE indicator iFractals, it is an array for the upper fractals
static double Lower[]; // array for the LOWER_LINE indicator iFractals, it is an array for the lower fractals
for( int j=1; j<=2; j++ )
{
if( j==1 ) period=PERIOD_H1;
if( j==2 ) period = PERIOD_H4;
//--- create a pointer to the iFractals indicator object
Fractals_handle=iFractals(NULL,period );
//--- if an error occurred while creating the object, print the message
if(Fractals_handle<0)
{
Print("The iFractals object was not created: Execution error = ",GetLastError());
//--- forced program termination
return(-1);
}
//--- set the arrays indexing order as in timeseries
//--- if an error occurs, stop any further operations
//--- filling declared arrays with current values from all indicator buffers for fractals
if(!GetFractalsBuffers(Fractals_handle,0,100,Upper,Lower,true)) return;
// here is the line of check of the indicator work
} // loop end by J
If the loop over j is removed in the above code and a concrete period is inserted into the Fractals_handle=iFractals(NULL,period ); function, the program will work.
In the loop, it generates an error during compilation:
'period' - unexpected token Sov_MA_ADX.mq5 482 47
Please advise where is my mistake and how to correctly format this part of the program.
Hello Mr. Masters, I've just started to study MT5 intensively, I'm testing all possible options here. I usually open profit by trend but then they start moving to the other side and as a result I get losses even if I wait too long and hope everything will go right and I will be happy. Would it be possible to make such an expert that would open a position with a 4 or even 10 point delay, i.e. if it did not move in the direction it was supposed to move to, thank God. In general, if I think about it, it turns out the same way and "We can't predict????", but I guess it happened twice a day with more than 100%. So how do I get into this stream and follow it? At the post office lately began receiving letters offering to buy the so-called "Grails". How did they find out about my mail and, most importantly, about my interest in this business?
They are grails for the sellers, because they help you pull your money out.
Learn from professionals, watch interviews with people involved in trading, forex and most importantly algotrading, what they have to say about what you can earn.
The idea you described is just a methodology of entering a position. The important thing is to find a signal that, say, at the same stops and profits provides 65% + profitable trades. And then you can find the best input and money management. It cannot be done in any other way.) It's like building a car without an engine.
They are grails for the sellers, because they help you get your money out.
Learn from professionals, watch interviews with people involved in trading, forex and most importantly algotrading, what they have to say about what you can earn.
The idea you described is just a methodology of entering a position. The important thing is to find a signal that, say, at the same stops and profits provides 65% + profitable trades. And then this signal may lead to the best input and money management. It cannot be done in any other way.) It's like building a car without an engine.
Hello professionals, Happy New Year.
Please advise me how to deal with the situation with time lag between opening of bars in the Strategy Tester and opening of bars of the timeframe.
For example, I set in my Expert Advisor the beginning of testing on 13.01.2011. In this case, the opening time of the first bar in the Strategy Tester on the hour timeframe will be 2011.01.13 00:00:00,
and the opening time of the first bar in the Expert Advisor using the function
i=CopyTime( _Symbol,0,1,100,Time_buf); // copy the historical data time for each bar of H1 timeframe into the buffer
if( i<0 )
{
Print(" failed to copy time values from the price chart buffer ");
}
get Time_buf[0] = 2011.01.12 23:00:00 - 1 hour delay.
I understand this situation is standard and it has been solved by many experienced traders. Are there any publications on this subject? I have not found any solution in the articles.
Or share your experience, please.
Please suggest a way out of the situation, which is related to the time lag between the moments of opening bars in the tester and the bars of the timeframe being formed.
You set this backlog yourself, try it this way:
You set this backlog yourself, try it this way:
Thank you very much for the advice. Very much appreciated.
Specifically, I need access to the MA buffer on the Standart Deviation indicator