[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 31

 
Guys, can I get some help or is this not a question for this thread? Article 29 (at the top)
 
Vinin:

You have to look at the advisor. There's no way to tell.
I understand. I posted the advisor. Can't you look at it?
 
fergios:
Guys, can I get help or is this question not for this topic? Art. 29 (at the top)

Open Buy at Ask price, close it at Bid price.

Open Sell at Bid price, close it at Ask price.

Read the rules for trading operations.

But don't forget about slippages, requotes and the like...

 
volshebnik:
Something is wrong .............. I choose one parameter (MA period), set optimization for just one day. It shows a horizontal line on the result chart, although there should be both negative and positive trades. I set any of them to test on the same day (upon which I optimized) and show...- in terminal - "Waiting for update", but in log: 2011.01.28 11:19:16 TestGenerator: no history data 'GBPUSD1'.

No history data. Where is the Expert Advisor located?
 
Vinin:

There is no historical data. Where does the councillor lie?
Shit, I've confused you, sorry. I put it from 2000.01.10 to 2000.01.10. Probably it should be at least till 2000.01.11. (It's to the previous post) The Expert Advisor is here: https://www.mql5.com/ru/forum/131277/page28
 
artmedia70:

Open Buy at Ask price, close it at Bid price.

Open Sell at Bid price, close it at Ask price.

Read the rules of trade operations.

But don't forget about slippages, requotes and so on...


How should I represent it programmatically?



I was also thinking of something else. Take, for example, BUY and jump from it, i.e. set a parameter that will check >= 150, but then I don't know how to implement it, but if the condition is true, then close all open orders, but how to do it programmatically, I have no idea.... I tried through OrderClose, but it did not work.

This is how I see it.

if (OrdersTotal >= 1)
{for (g_pos_116 = OrdersTotal() - 1; g_pos_116 >= 0; g_pos_116--)
{if (OrderSelect(g_pos_116, SELECT_BY_POS, MODE_TRADES))
{if (OrderSymbol() != Symbol() || OrderMagicNumber() != 111) continue;
if (Ask - OrderOpenPrice() >= pip * Point)

{if (by == true)

{// здесь вот должен быть код, закрывающий этот ордер}

{if (se == true)

{// здесь вот должен быть код, закрывающий этот ордер}

..И вот так вот продолжить проверку всех отрдеров

}}}}}


What do you think about it?

Z.I. The code was written quickly, there might be mistakes, but the sense will be clear, in fact the upper part checks the condition, and we need the lower part of the code
.

 
volshebnik:
And the advisor is here: https: //www.mql5.com/ru/forum/131277/page28

Can I attach it as a single file, or do I have to build it as well?
 
Vinin:

Can I attach it as a single file or do I have to assemble it too?
Yes, of course !
Files:
transer.mq4  19 kb
 
volshebnik:
Yes, of course !

The Expert Advisor works, it is optimised. I only had a problem with the lot size
 
fergios:

How do you do it programmatically?



I was also thinking about something else. Take for example BUY and jump from it, i.e. set a parameter that will check >= 150, but then I do not know how to implement it, but if the condition is true, then close all open orders, but how to do it programmatically, I have no idea.... tried through OrderClose, but it did not work.

This is how I see it.



What do you think about it?

Z.I. The code was written quickly, there may be errors, but the meaning will be clear, in fact the upper part checks the condition, and we need the lower part of the code

What can I tell you. All the fishing rods have long been made. If you want to learn how to code, start by reading the tutorial, it contains an example of how to create a ready-made Expert Advisor, and look through ready-made functions for all occasions.

That way, you will be able to write what you need. But if you just want to quickly create here and there, the knowledge will not increase. Of course, they will help you sort out your code and do what you need, but... Do you need it? IMHO of course, not for me to judge.

By the way, I still don't know what you're comparing to and what you're trying to get. 150 says nothing...

- Petya, instruments!?
- 200 !!!
- 200 what???
- What about the instruments???

Reason: