[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 718

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
You read the file line by line and assign values to your variables each time. When the file ends, the variables will have the last values.
How to implement this?
I can't figure out what to use
How to implement this?
Can't figure out what to use
A lot has already been written and re-written about this, try https://www.mql5.com/ru/forum/118349
Good night again! I have recently started writing a multicurrency EA that opens orders on one currency pair and opens orders on another one.
I ripped out the nearest trailing stop from the EA and started to play with it but it did not work. Here is the code:
here is what I cannot figure out. Since the Expert Advisor is a multicurrency Expert Advisor, it opens orders for currencies in unpredictable manner and sometimes opens them at one and the same moment for several currencies.
In the trailing code I calculate open orders for(int i=0; i<OrdersTotal(); i++) and further goes order selection OrderSelect etc. I understand that each open order for a certain currency pair requires data bid, ask, etc. But here I want to find out what data should be downloaded and how will I select an order for changes? I have only one variant in my mind, the worst one is to write a trailing stop for each currency ) Please advise what may be done.
Good night again! I have recently started writing a multicurrency EA that opens orders on one currency pair and opens orders on another one.
I ripped out the nearest trailing stop from the EA and started to play with it but it did not work. Here is the code:
here is what I cannot figure out. Since the Expert Advisor is a multicurrency Expert Advisor, it opens orders for currencies in unpredictable manner and sometimes opens them at one and the same moment for several currencies.
In the trailing code I calculate open orders for(int i=0; i<OrdersTotal(); i++) and further goes order selection OrderSelect etc. I understand that each open order for a certain currency pair requires data bid, ask, etc. But here I want to find out which data to load and how to select an order for changes. I have only one variant in my mind, the worst one is to write a trailing stop for each currency ) Please advise what may be done.
Infinity:
I don't quite understand the technology, how it will work
A lot has already been written and re-written about it - try https://www.mql5.com/ru/forum/118349.
int a1;
int handle=FileOpen("a1.csv",FILE_READ|FILE_WRITE,';');FileWrite(handle,a1);
FileClose(handle);
In the file a1=5;
I do not understand the basics.
int handle=FileOpen("a1.csv",FILE_READ|FILE_WRITE,';');here we assign value 5 to a1
FileClose(handle);
very necessary
but declared with a value assigned to it:
int ask = MarketInfo(sy, MODE_ASK), bid=MarketInfo(sy, MODE_BID), open, stop, level;
Accordingly
should already be written otherwise, for example:
Or create another variable, e.g. PriceBid and write
and then use PriceBid instead of Bid in the code...
Look through all your code and use variables for a particular symbol where necessary.
And this symbol you will pass to the trawl function when calling it:
or
Is it clearer?
Assign values to variables in the trawl code based on data on the pair passed to the function. You need to finalize the trawl code... For example, the Bid variable should not just be declared,
but declared with a value assigned to it:
Correspondingly
should already be written otherwise, for example:
Or create another variable, e.g. PriceBid and write
and then use PriceBid instead of Bid in the code...
Look through all your code and use the fetching of variable values for a particular symbol.
And this symbol you will pass to the trawl function when calling it:
or
Is it clearer?
The only thing I don't understand is which currency pair should be sent to me at which moment. I don't know where to get information that, for example, 4 orders are open on such pairs and that these pairs should be sent to me.
I don't know if I'm doing it right or not... anyway ....
But for some reason I got an error EURUSD: zero divide - this error probably means somewhere in the variable 0, probably during a split-type operation. Am I trying to implement it correctly at all?
int a1;
int handle=FileOpen("a1.csv",FILE_READ|FILE_WRITE,';');FileWrite(handle,a1);
FileClose(handle);
In the file a1=5;
Misunderstanding in the basics. Please explain - by completing the proposed
int handle=FileOpen("a1.csv",FILE_READ|FILE_WRITE,';');here we assign value 5 to a1
FileClose(handle);
I really need it.
So, in order.
If only the latest data is needed, then why save the previous ones? ("before write" occurs with combination of FILE_READ|FILE_WRITE modes).
Therefore it is more logical to use FILE_CSV|FILE_WRITE mode, where previous records are deleted before writing new data.
Let's start writing 4 variables to the file.
The main thing is to remember the order in which the variables are written, because this is the order in which we will read them.
Let us start reading data into variables from the file.
Using the FileReadNumber() function, we read the number after the number in the order in which they were written.
That's all there is to it, nothing complicated :)
The only thing I don't understand is which currency pair should be sent to me at which moment. Where do I get the information that, for example, 4 orders are open on such pairs and that these pairs should be sent to me?
I don't know if I'm doing it right or not ... anyway ....
But i got EURUSD: zero divide error. Apparently, this error says i have 0 in a variable somewhere, probably, it's a division operation. Am I even trying to implement it correctly ?