Ask! - page 133

 

Not all indicator_buffers showing on screen

found issue. please ignore.

 

Update Arrays

Hi everyone

I have array which keeps result of n transactions from orders history window in form:

Buys

if order profit >0

traintest[x][y]=1 win

if order profit <=0

traintest[x][y]=2 loss

(same for sell orders)

My question is :how to update these arrays after ,let say k new transactions ? Now my procedure updates it after each new buy sell order , when it is call from main procedure.I stuck completly whithout any idea

ty in advance

 
:: What do you want to do with them? clear them? to sort them? refill them at start? or add more?
Dakhr:
Hi everyone

I have array which keeps result of n transactions from orders history window in form:

Buys

if order profit >0

traintest[x][y]=1 win

if order profit <=0

traintest[x][y]=2 loss

(same for sell orders)

My question is :how to update these arrays after ,let say k new transactions ? Now my procedure updates it after each new buy sell order , when it is call from main procedure.I stuck completly whithout any idea

ty in advance
 

Refill (update )them after k transactions from last use

 
:: then I'm afraid it's all about the way you do your loop function... like you have to refresh it all the time a new transaction is made

IN10TION

Dakhr:
Refill (update )them after k transactions from last use
 
IN10TION:
:: then I'm afraid it's all about the way you do your loop function... like you have to refresh it all the time a new transaction is made

IN10TION

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

 
:: you can make it complex as you want ... but the only thing that stays the same is that you have to be able to refresh/refill your array with the open orders (easily to get) &/or go into history listing (easy to get to), to refill the previous data... don't use a file if all data is already easily available in metatrader... if there is specific info/data you want to keep, then yes, but figure things out first if you really need that...

:: if you only want to add something to the array without going in a loop of everything, then yes, you have to remember the last position, to fill in the next... otherwise you will delete the previous... if you do this, then the procedure of the code will be much faster... nevertheless you need the restore procedure to.

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
 
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.

 

Get Time input from a file

Hi all, i want to ask how to write the coding that can get day, hours and minute from a file ? i know it need arrays inside our coding, but im poor in writing arrays. The concept is like Multiple10pointsX2 ea, we able to input the news time weekly into the file, then the ea will read from the file that the news time happen, so the ea will stop trading at that moment. Thanks for any help !!!

 

Need help...

Could u someone here help me to add alert to this filter,when it cross 0 level or change color.

Thank`s for u who want to help me...

Files:
Reason: