To get a random result, you can take MathRand() and use the modulus operator, it gives the reminder of division.
Source code viewerif(MathRand()%2 == 1) { OpenSell(); }else { OpenBuy(); }Programming Language: MQL5