Forum

How do I count the total money amount of consecutive losses?

For example, below are my trades Trade 1: -100$ (lose) => loss_count = 1, loss_amount = -100 // Identify the first loss and assign it into loss_amount var Trade 2: -200$ (lose) => loss_count = 2, loss_amount = -300 // 2nd loss, negative profit will be cumulate loss_amount++ Trade 3: +100$ (win) =>

Backtesting takes too long

Hello everyone, im struggling with backtesting EA. Normally when I backtest with visualized chart, it will run through smoothly. But with the code below, it doesn't do it quickly any more. Even if I just run the backtest without chart, it will eventually disconnect and stop the test after a few

Can someone please identify the the cause of this? < [invalid request] OrderSend failed with error 4756 >

Im writing an EA which will place market order at a specific time, everything seemed to be right, no bug, no warning were found when I compiled it. But the problem is when I run it, the system kept warning that my order is invalid CTrade::OrderSend: market buy 0.66 EURUSD sl: 1.07209 tp: 2.00000

(MQL5) How to limit trade function to open only 1 order only

Hello everyone, I'm new to coding, currently Im writing one that will open trade based on a specific time. For example, if the current time is 21:00:00, and match the condition time, it will open a market order. However, the problem is the OnTick() function requests the order continously, it lead to