Forum

Cooldown Activates Immediately instead of After Closing trade

Hello, I am working on an MQL5 trading bot , but I have an issue with the cooldown period. Right now, my bot activates cooldown immediately after opening a trade instead of waiting for the trade to close. Here is my OnTick() function: void OnTick () { static datetime lastDay = 0 ; datetime

My ea shows failed market buy 0.2 BTCUSDm Invalid request

I'm new to programming and i wrote a code for my ea but the journal shows failed narket buy 0.2 BTCUSDm sl: 105348.0200 tp: 105349.5200 [ invalid request ] and i do not know what to do. this is my OpenTrade Function. void OpenTrade( int orderType) { MqlTradeRequest request; MqlTradeResult