Should I do this or should I not?..
If you are able to quantify the probability of a particular event you can rely on random numbers to take decisions. Here goes a coin toss example where you can decide the probability (from 0 to 100) to get heads. You can add the following method to the class CBrain explained in the article Another MQL5 OOP class. Let's recall that CBrain may be the core of an object-oriented EA where you put things that determine its behavior.
Just an idea. Greetings!
You're right, thanks for the tip. I'll do that next time ..
Just make a quick note, better to work with short types instead of int types if this method is intended only to flip a coin, I mean f there are only two events (head or tails) then let's consume as less memory as we can. This way the computer consumes less memory.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Should I do this or should I not?..
If you are able to quantify the probability of a particular event you can rely on random numbers to take decisions. Here goes a coin toss example where you can decide the probability (from 0 to 100) to get heads. You can add the following method to the class CBrain explained in the article Another MQL5 OOP class. Let's recall that CBrain may be the core of an object-oriented EA where you put things that determine its behavior.
Just an idea. Greetings!