[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 277
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
https://docs.mql4.com/ru/array/ArrayResize
Yes, indeed. Had a look, but didn't see it.
Thank you. (chuckles)
I'm slowing down today. Got to rest up for the weekend.
That's about right -
Thank you!!! I'll be using....
DDFedor
Rid
Thank you.
All the same, the code did not work, did all the action on 2 candles. and had to learn that the position already have more do not open ... because it opened at all that I could all the deposit used(( Rid look, maybe what else you need to add ... would be very grateful
Help. I want an EA that will trade at night. I am writing code
int start()
{
string Symb;
Symb=Symbol();
string Vremya;
Vremya=TimeToStr(TimeLocal(),TIME_MINUTES);
if(Vremya > 23:00 || Vremya < 06:00 )
{
// тут торговые функции
}
}
It generates an error
'||' - condition cannot be a string
And if the condition is shortened to
if(Vremya > 23:00
it will work,
And if it goes to
if(Vremya < 06:00 )
it won't work.
I don't understand what's wrong. Can you tell me how to set the time?
Rig Rig didn't work anyway...but i should have known i had a pose and not open it anymore...but i opened it for everything i got the entire deposit.
Yes indeed....
I forgot to set the magik in the ORDERSEND fi.
It's working fine now. Checked. There can be no more than two differently directed trades or no more than one unidirectional trade in the market.
If it is necessary no more than one deal of any type, it is necessary in f-ki NumberOfPositions(c) to replace type of deal with -1 (minus one)
Please tell me what the iTime function shows.
What is that gibberish of 10 digits? Seconds?
How do you translate them into year-month-day-hour-minute?
>> Like this: just set bar shift and get default time and date (if time=1 or true, you get only time).
Very handy feature, I recommend it.
I tried to adjust the second level, but it didn't work.
I tried to do it but it would open and close one order immediately after the test
Got it. To determine if there were positions on the history, you can do this:
But then your code will only work in tester. Otherwise, you will have to change the magik every time you switch on the EA online.
Exactly, that's exactly what we need!
Please advise how to insert this code correctly in this grid:
(If I put it directly, the tester just stops at the opening of the first position)
I tried to adjust the second level, but it didn't work.
It seems to be quite logical but in the test it opens and covers orders at once
I dealt with closing positions at my time here -
https://www.mql5.com/ru/forum/105913
This block must be inserted inside the START function, maybe at the very beginning, right after calculation of Ema_1,Ema_2,Ema_3.
And, apparently, it is necessary to make advisor work by PRICES OPEN, otherwise MA crossing will constantly close the open positions on almost every tick.
And the way you have done - it would not work correctly online, because EA will close all positions, even those opened by another EA or manual ones.
But I have already written how to make it even simpler. Instead of NumberOfPositions(NULL,OP_BUY,Magic) and instead of NumberOfPositions(NULL,OP_SELL,Magic) when opening positions, just set
NumberOfPositions(NULL,-1,Magic)
and then there will be no more than one position in the market all the time. Without any closing blocks.