[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 935

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
Hello, I am interested in this question. Does alpari provide a server where you can upload your advisor so it can work round the clock? Would you be kind enough to reply in person?
It's not working, maybe I need to change something here or put it after the start.
I tried to translate your code on paper into Russian I understand, but it doesn't work,
it's too complicated, especially when the conditions in each condition follow, and one condition out of eight conditions.
Of course I don't argue who created this code is a miracle, but for me it's a complete perversion (in a good way)
I am not lazy to add comments to each operation and condition, except for the standard function.
There is some redundancy in the code, but the code is quite readable
Something's not working for you, not this code... :)
That's all the logic... Viktor was right - it's redundant, but as simple as possible... :)
question about changing the period in the program ... for example there is a certain sequence of operators which should be applied to different periods ... as I understand it is easier to do it in the form of a timeline ... by changing the period... I find a function in the documentation that returns a period value... but I can't find a function to change it... what am I wrong ?
The period of the graph can be any of the following values:
Thank you very much, I just need some clarification ... for a group of operators to work on a certain period is it enough just to specify one of the periods in front of them as they are presented in this table?
To give the right answer to your question, you need to see at least a sample code where you specifically need to set the period...
string trend()
{int count,count_change;
double bar_centr;
string trend;
bool clear;
for (int i=10;i!=0;i--)
{
bar_centr = (High[i]-Low[i])/2+Low[i]);
if (bar_centr>((High[i+1]-Low[i+1])/2+Low[i+1])
count++;
if (bar_centr<((High[i+1]-Low[i+1])/2+Low[i+1])
count--;
}
Print (count, "period ",Period());
if (count>3) trend="buy";
if (count<-3) trend="sell";
if (count<3||count>-3) trend="uncertain";
return(trend);}
this function needs to be applied consistently to different periods ... It works if I connect it to windows in the terminal with different timeframes ... The question is if it's possible for EA to handle several different periods ...
this function must be applied successively to different periods ... It works if I connect the EA to windows in the terminal with different periods ... The question is if it's possible for EA to handle several different periods ...
I understand that you want your function to work not only with current chart and period, but with any of periods, passed to it ...
Now, call your function like this
trend(Symbol(), Period()); // It will return values for the chart and period in which the EA is hovering...
trend(USDJPY, PERIOD_D1); // It returns values for the USDJPY symbol and period of "1 day"
Instead of PERIOD_D1 you can enter 1440 - it will give the same result...
If it is called without parameters, the function returns values for the current symbol and period (they are set by default)
I understand that you want the function to work not only with the current graph and period, but also with any graph passed to it...
Now call your function like this:
trend(Symbol(), Period()); // It will return values for the chart and period in which the EA is hovering...
trend(USDJPY, PERIOD_D1); // It returns values for the USDJPY symbol and period of "1 day"
Instead of PERIOD_D1 you can enter 1440 - it's the same...
comprehensive answer... thank you very much ...