Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 221
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
Ah. Writing from memory as I'm also at work. Try: and Ticket compare with the one in the orderclose report. In the tester it seems to be 0, 1, 2, 3, ....
I want to learn how to make an EA. Maybe the market will change and I will have to pay more, for example, to change the algorithm a bit?
I don't know if I can really make a TS in any owl constructor, but I'd rather understand the basic functions like making a stop in a certain place or order an order to trade on certain days.
I have no idea what to do with 1,2,3 etc. even in the constructor, and why it's important to connect everything in this order with arrows. Who delivers mql 4 training from A to Z and not like Internet warriors who create courses that explain nothing in detail why it happens this way, in words, you won't make anything new by yourself, you will just have to copy their code .... I mean, they know what order is responsible for what, and they didn't just point at random ..... Well, let the professionals do pyramiding, dynamic lot, smart stop; my task is different - to download the required filters and understand the essence of trend formation. Thanks for your help!
You only need documentation, which is available, and you need to be able to read and understand what you have read. If you have not succeeded in understanding it from the first time, read several times and preferably at a slower pace, so that your brain has time to recognize the meaning of what you have read.
And after that, the imagination has a free hand.
I want to open an order on condition Open the "Trade Functions" section of the documentation and find the function that opens the order and write it according to the syntax...
Oh, yeah... you have to meet the condition... ...open the "Operators" section, read"Conditional if-else statement" and write the necessary condition.
When that's done, you read the documentation from start to finish to figure out what's in the language, what you can get.
Wrote a function that allows no more than n orders to open in 1 day.
Now the function is draining the deposit - i.e. orders open on every tick.
Where did I screw up again?)
int OrderMax = 3; // maximum number of orders that can be opened during 1 day.
void OpenOrders()
{
for (int i = 1; i <= 5; i++)
{
if (DayOfWeek() == i)
{
int count_max = 0;
if (count_max <= OrderMax)
{
for(int cn = OrdersTotal()-1; cn>=0; cn--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) && OrderType() == OP_BUY)
count_max++;
}
}
}
}
}
Me again:)
I have written a function which allows to open not more than n orders in 1 day.
Now this function is losing the deposit, i.e. orders are opened on every tick.
Where did I screw up again?)
int OrderMax = 3; // maximum number of orders that can be opened during 1 day.
void OpenOrders()
{
for (int i = 1; i <= 5; i++)
{
if (DayOfWeek() == i)
{
int count_max = 0;
if (count_max <= OrderMax)
{
for(int cn = OrdersTotal()-1; cn>=0; cn--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) && OrderType() == OP_BUY)
count_max++;
}
}
}
}
}
In my opinion, the approach is not logical at all. Why define the day of the week? What difference does it make what day it is, if the condition should say "do not open more than xxx orders today"?
It seems more reasonable to me to count orders opened today and place an appropriate condition in the condition.
missing the definition of the opening date of the order.Rustam Bikbulatov:
Ребята, можно ли с помощью одного советника открывать ордера на других парах? Например Советник только стоит на паре EURAUD и при условии открытии открывается сделка на парах EURAUD и GBPUSD. Какое должно быть условие если будет возможность?
Only in the tester it doesn't work.
Yes, it does.
Only in the tester it doesn't work.
How do you list them, comma or &&?
How do you list them? comma or &&?
Theirs is a what? a list of characters or what?
Each OrderSend has its own single character. No commas or other stuff...
Theirs is a what? a list of characters or what?
Each OrderSend has its own single character. No commas or other stuff...
list pairs
Ah. Writing from memory as I am also at work. Try: and Ticket compare with what the order has in the report. In the tester it seems to be 0, 1, 2, 3, ....