Ilan, est-ce que ce genre de codage peut vous aider?
I agree with you, that trying to trick the broker by changing magic numbers won't work. However, I know some people might disagree with us. I was trying to include an option for someone where I can say "ok, you think brokers may track by magic number, and you don't like that. so here is an option to prevent that."
That little nugget came into my mind, and I wanted to see if I could tackle the issue. I found a way to make it 'work'. If I only call rand() right after seeding with a constant seed, it returns the same number every time. So using the day+month from OrderOpenTime()as the seed will return the magic number that I used from that same day. But I see I've been trying to solve an imaginary problem, though. I guess it just turned into a puzzle for me that I had to crack, rather than trying to find effective code. What I was trying to do would probably also cause problems for people that were trying to use another EA to interact with orderhistory for example. Thank you for your help.
That is because you refused to answer the question "why do you think you need a random number." That answer is your true issue. I answered your question (#3)
that you do not want random MNs (which you ignored,) and others also
asked (which you refuse to answer, and insist on your way.)
If you use any random sequence, then on a terminal restart, you will have a new MN and loose connection with any open orders. #6 is wrong the moment you hold an order overnight . All you've done is alienate those trying to help you and your "solution" will cost you.
Yes, you are right. Thank you for posting the link earlier. I've been studying what you said, and I think building an array of magic numbers for the different strategies using a similar method to the one you posted may work best
Je vais probablement utiliser ceci:
for(int i=OrdersHistoryTotal-1; i>=0; i--)