Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 663

 

Can someone suggest, I install the plugin GetTickerHistory in MT-4, runs, but the download does not go, is it possible to download the external indexes in another way.

Many thanks in advance.
 
Please advise how to implement the idea. On every tick we open two buy and sell orders, if (for buy) there are no orders at the current Ask price in the market. For sell the same but with a bid. thanks in advance.
 

Question about OrderSelect(i, SELECT_BY_POS, MODE_TRADES)

Do I correctly understand that in this mode of selecting/searching through orders, their order is not guaranteed? I.e., after a terminal restart or some other "cataclysm", the search cycle of all orders may show them in a different sequence?

A small check shows that the order of orders does not change immediately after we have created the N-th order. If we close/open the terminal, the orders are sorted first by the symbol name, then by the ticket.

Anyway, we would like to know all the details of order selection in the SELECT_BY_POS mode...

 
TarasBY:

There is some confusion about adding 0, but try it this way:


Noli was advised here on the forum once a long time ago to add an index to i.

I did, everything as told. I can't draw it after the countdown. Green and red dots go together.

For instance, I want to mark when "line1 > 0." and after a certain number of bars and on condition that "line1 > 0." is drawn.

I was able to do it in the Expert Advisor, but I cannot do it in the indicator.

1

 
Forexman77:

Noli once advised here on a forum a long time ago to add an index to i.

I did as they said. I can't draw it after the countdown. Green and red dots go together.

For instance, I want to mark when "line1 > 0." and after a certain number of bars and on condition that "line1 > 0." is drawn.

I was able to do it in the Expert Advisor, but I cannot do it in the indicator.

I have corrected the obvious error: adding bar index to time. All the rest is the author's "flight of fancy" - experiment with it.
 
TarasBY:
I tweaked the glaring error: adding a bar index to the time. Everything else is the author's "flight of fancy" - experiment.

Did some brainstorming for myself) And found a solution:

 for(i=limit1;i>=0;i--) 
   {
   line1=0.;
   signal_line=0.;
   line1=iCustom(NULL,0,"indikator1",Period_MA_r,r2,1,i+0);
   signal_line=iCustom(NULL,0,"indikator2",Period_MA_1,p2,0,i+0);
   if (line1 == 0){shift=0;}//если индикатор равен нолю, то время сбрасывается на ноль
   if (line1 > 0.){shift=shift+1;}//на каждом баре плюс один
   if (line1 > 0 && signal_line < s)ExtMapBuffer1[i] = Low[i] - 95.*Point;
   if (line1 > 0 && shift >= shet && signal_line < s)ExtMapBuffer2[i] = High[i] + 95.*Point;
   }
 
genino:
Please advise how to implement the idea. On every tick we open two buy and sell orders, if (for buy) there are no orders at the current Ask price in the market. For sell the same but with a bid. Thanks in advance.

Then you check if there are any open orders and check their properties: order type and at what price the order is open, then you send a request to open the order or not. Everything is simple, what are you confused about?)
 
AlexPORT:

Question about OrderSelect(i, SELECT_BY_POS, MODE_TRADES)

Do I correctly understand that in this mode of selecting/searching through orders, their order is not guaranteed? I.e., after a terminal restart or some other "cataclysm", the search cycle of all orders may show them in a different sequence?

A small check shows that the order of orders does not change immediately after we have created the N-th order. If we close/open the terminal, the orders are sorted first by the symbol name, then by the ticket.

Anyway, I would like to know all the details of order selection in theSELECT_BY_POS mode...


I also tried to discuss this question on this forum about a year ago. The fact that you have not received an answer shows that the situation has not changed much since then. We users ourselves don't know exactly how it happens. And I haven't found any explanation from MetaQuotes on this subject either. You can go directly to the developer, if you want and can spend time and effort on this.

Personally, on my observations, the issue is as follows (but these observations, not officially documented feature - for official - it is MetaQuotes should announce). When you have the terminal loaded you, as a user, have the ability to set sorting filters: by ticket, open price, order type, etc... For this, just click on the header of the relevant column. The sorting order will change depending on this. When orders are opened during the trading process, they are recorded as they are placed, cancelled and closed. When the terminal is restarted, of course, all this is read and sorted according to the default settings (sort of by ticket). And so on and so forth... I won't enumerate all possible sorting variants, inquisitive mind can complete them by itself. The moral of what I've said here is different (it's like this): To correctly manage the order selection and sampling sequence, you must first do the necessary sorting yourself. To do this, we must use proper sorting algorithms. If there are few orders, just about any algorithm will do. But if there are a lot of them... This is a specialized "song". You need to have a good understanding of these algorithms. Otherwise, it may happen that sorting will be very time-consuming.

There was a sorting algorithm in the codebase somewhere. It seems to be a bubble algorithm. I couldn't learn how to use it - I repent.

Here's something from this series: https://www.mql5.com/ru/code/9336

Bottom line: you are right - the ordering of orders is not guaranteed. For a guaranteed result, you need to do selection and sorting based on your program's objectives.

 
igalx:
Is it possible to download charts for technical analysis, in MT-4 - indexes S & P 500 Futures Chart, TA 25 Chart, and the S & P 500 Chart if possible can tell you how to do this, maybe there is an explanation of how to download!

Please be more specific in your question. Of course, I can guess (assume) that you're talking about some online service. But by typing your listings into a search engine, I got a lot of different options. And I would like to understand, why do you need it? What is your purpose?

But if you mean service, then why not do the analysis in this service? In MT4 you can use the quotes from the terminal, if your broker provides them. If not, download the terminal of any popular brokerage company. And even more.

 
igalx:

Can someone suggest, I install the plugin GetTickerHistory in MT-4, runs, but loading does not go, is it possible to download the external indexes in another way.

Thanks in advance.

Who is your broker? Probably a brokerage company? They have all these external indices - right click on the "Market Watch" window - "Symbols" - choose whatever you need and enjoy. And it will be extremely helpful to read the chic description of the terminal by pressing "F1" - Help. MetaQuotes have done well here - they've implemented it well. After reading it, you will become a trader with another skill level. I recommend it to everyone.

Tip 1: When you ask for help with a plugin, it would be a good idea to attach it to your post. It's not like we're scouring the search engines to find it, install it and help you with your difficulty. And to understand the difficulty of the plugin, you need the source code in "mq4" format.

Tip 2: This forum (branch) is for programming, not for using the terminal. Therefore, non-programmer questions here can not answer - will be ignored.

Reason: