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

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
I had an idea to draw an indicator from the file data.
I took an example from the textbook. Reworked the script to suit my needs:
The "Alert" line can be removed.
The logic is to get the date in the indicator and compare it to the file and assign the value to the buffer in case of coincidence.
But I think that if we start search for each bar from the beginning of the file, where the data is already taken into account, it will be quite expensive.
The question is how to fix the processed file lines in the indicator and start search after them?
There is a large file with dates in this form "20141231". To convert the string todatetime formatyou need"YYYY.MM.DD"dots between the year, month and number.
How can this be done?
Thank you, I've already sorted it out. Converted the file where it was originally separated by commas. Changed the commas to dots and then added a second column, all with "uniCSVed".
Now I'll know how to do it programmatically.
Now I face another titanic task: how to fulfil indicator with these data? I have made a script. It works correctly.
But in the indicator, in order not to have brakes, I need somehow to remember the line in which in the last iteration of the data was obtained.
Thank you, I've already sorted it out. Converted the file where it was originally separated by commas. Changed the commas to dots and then added a second column, all with "uniCSVed".
Now I'll know how to do it programmatically.
Now I face another titanic task: how to fulfil indicator with these data? I have made a script. It works correctly.
But in the indicator, in order not to have brakes, I need somehow to remember the line in which in the last iteration of the data was obtained.
It is probably possible with FileTell (Returns current position of the file pointer of the corresponding open file) and FileSeek (Moves the position of the file pointer by the specified number of bytes relative to the specified position).
Thank you! I also paid attention to these functions. There isalsoFileIsLineEnding. I will think further on how to do it.
How do we define Ticket_first_order?
Assign the value of OrderTicket() to a variable. For example: int Ticket= OrderTicket(). And then use this value in OrderSelect.
OrderSelect(Ticket,SELECT_BY_TICKET); .
We can do it in another way. We will not define the ticket, we just find the order by trying (SELECT_BY_POS).
We will get it:
string Symb=Symbol();
for(i=0;i<=OrdersTotal() ;i++)
{
if(OrderSelect(i,SELECT_BY_POS)==true)
{
if(OrderSymbol()!=Symb)continue;
if(OrderType()==OP_BUY)
{
break;
}
}
}
if(OrderOpenPrice()+10*Point<=Ask)
OrderSend(Symbol(),OP_BUY,Lot,Ask,10,Ask-SL*Point,Ask+TP*Point,NULL,Magic,0,Green);
Assign the value of OrderTicket() to a variable. For example: int Ticket= OrderTicket(). And then use this value in OrderSelect.
OrderSelect(Ticket,SELECT_BY_TICKET); .
We can do it another way. Let's not define a ticket, but just find the order by brute force method (SELECT_BY_POS).
It will work out:
Since this is a topic for beginner's questions, I'll ask mine...
1. Is there a software API for downloading quotes? Ideally a get/post request.
2. If there is no such thing for broad access, what are the easiest platforms to parse and can provide real-time access to quotes once per second.
3. You can write automation on anything, of course. But I would still like to know which languages and tools are the most convenient and popular?