Forum

Close orders by script

I'm trying to make a code to execute a script like this: // Check the account equity and disable trading if needed void CheckEquity() { double equity = CalculateEquity(); if (equity - initialEquity >= takeProfit || equity - initialEquity <= stopLoss) { tradingEnabled = false

Code checking - EA that opens position when candle closes above/below MA (MT5)

Hi everyone! When I compile the code below there are 2 errors: '}' - unexpected end of program Hota001.mq5 89 6 '{' - unbalanced parentheses Hota001.mq5 17 3 But when I add an } in the end, the errors jump to 17. Any help? // Define the input parameters input int ema_period = 9 ; // Period for