Quote:
Originally Posted by Dakhr
Thanks man
Things seems little bit clear
Let me think :
Example:after first call(buy/sell) i fill array:
1,2,3
4,5,6
7,8,9
Let say new transactions appeared in history: 1',2',3' I want new array look like this :
1',2',3'
1,2,3
4,5,6
Should I count how many times procedure was call after each buy/sell When i reach required calls i update array .I'm right?
But after restarting terminal i lose this information.Should i write this to file??
Thanks again
|
Maybe I don't understand your question, but it seems to me useless to write a file with information easy to retrieve from the server (I mean the history of your trades)
What seems easy is to loop thru the history every tick (it's fast) or every new M1 bar, or when you want, and keep the count of the orders matching a specified MagicNumber. In the same loop, you store the CloseTime of each trade in the first of a two dimentional array, and for example the Ticket in the second one. Then, if your count was incremented by tree, update your static counter (+=3) and sort the array by the first dimension in descending order. From that sorted array, you can build easily the second array like you want.