-
Re: Helps with lot size in EA
Hi, I created an EA using FXPRO QUANT but I can�t get a particular condition to work. I want the lot size to increase in steps if the previous operation with that same magic number was won. And it�s restarted at the initial value if the operation was lost. Could anyone give me a hand? Believe in your analysis and keep the plan, don�t panic with the moves.
-
Re: Helps with lot size in EA
I think it would be useful for you to share more specific details about how you want to calculate lots. When should they increase? How much? When to reduce? How? How and when to restart? Without that data, we can only guess what you need.
-
Re: Helps with lot size in EA
Sorry, I forgot to attach the EA. I want the lot to double (either by fixed steps or multiplication)
-
Re: Helps with lot size in EA
Change the "lot size" and the "lot step" as you like, compare it and try it.
-
Re: Helps with lot size in EA
Thanks, but for some reason it's not working for me, bro. When I compile these errors, I get these errors: The statement of ''MagicIndex'' hides the global statement on line 19 It's missing to check the returned value of ''OrderSelect''' on line 232 Believe in your analysis and keep the plan, don't panic with the moves.
-
Re: Helps with lot size in EA
Can no one really add that function to the EA? Believe in your analysis and keep the plan, don't panic with the moves.
-
Re: Helps with lot size in EA
Maybe you could look for an EA that is already working well and modify it with the conditions you�re looking for. The code you have is not a good starting point, you can�t even run a sales order correctly. Also, you need to have operations in the history to start operating. I started cleaning it but honestly I don�t care to continue. It compiles error-free now, and the magic number is consistent in all functions (before it wasn�t.
-
Re: Helps with lot size in EA
Here's another sign crossing EA. Double the lots when there's a winning streak. It's generic, you can buy, sell or both. It includes plenty of info for debug, so you can edit it yourself and adjust it as you like.
-
Re: Helps with lot size in EA
Thank you very much, brother. I appreciate your help. You�re very close to what I asked for, only a minor detail is missing, I don�t know if it can be implemented or not. The EA you shared just doubles the lot in the second operation. The third one comes back to the minimum. I wanted it to continue to increase after every win, not to restart after one time. Believe in your analysis and keep the plan, don�t panic with the moves.
-
Re: Helps with lot size in EA
Hello everyone, Does anyone have an indicator that allows placing multiple purchase/sale orders or limits on a chart? Thank you. The fool�s work exhausts it because he doesn�t know how to enter the city.
-
Re: Helps with lot size in EA
Go to the ''Get Lots'' function, start at line 411. Change this: if( profitSequenceCount > 0
-
Re: Helps with lot size in EA
I uploaded a new version. I haven't seen it generate errors with the SL, I even tried it with EURUSD for quite some time. There's more information for debug. You can click on the text "Seq" to see all the internal variables (this doesn't work in the tester, only in live graphics).
-
Re: Helps with lot size in EA
Thanks for your effort, brother. But the previous version was more aligned with what I needed, it only required a couple of adjustments. BuyandSell�s function never worked as I wanted. I used only �Buy only� or �Sell only�, and that did work well in one direction. The SL could not be modified in any version. The old one put 1000 pips by default in pairs with yen. None of the versions makes purchases in pairs like EURUSD, GBPUSD, etc. It only works in sales or JPY pairs. These are the errors that come out to me: �invalid stoploss for OrderSend function� �OrderSend error 4107� I find the same in the new version when I put �Buy only�. Believe in your analysis and keep the plan, don�t panic with the moves.
-
Re: Helps with lot size in EA
I just want one thing in the previous version, bro: That allows you to operate in other pairs and that you can edit the stoploss. Believe in your analysis and keep the plan, don't panic with the moves.
-
Re: Helps with lot size in EA
I don�t know what to think. I have it running without mistakes. This is the result with EUR/USD in 15 minutes, with strategy tester in Oanda: 21,407 candles, 299 winning transactions, 564 with loss. Initial deposit: $10,000, final balance: $10,041. All were purchase deals. In addition, I added an option to take signals without waiting for a new candle.
-
Re: Helps with lot size in EA
I found the cause of the error with the SL. It�s a risk of testing during the weekend. When you test at the weekend, MarketInfo returns zero. With that, my calculation gave a minimum SL of 1 pip, which generated errors. Today with the open market, it returns 11 points (0,00011
-
Re: Helps with lot size in EA
Try declaring the MagicIndex with a different name to avoid conflict with the global. That should already remove at least one of the compilation errors.
-
Re: Helps with lot size in EA
Have you tried running the EA in demo account to see if it reacts the same as in the tester? Many times the behavior is different in real time.
-
Re: Helps with lot size in EA
Yes, I did it in demo and it behaves the same. The problem is with purchase orders, it just doesn�t throw them if it�s not even with JPY. Believe in your analysis and keep the plan, don�t panic with the moves.
-
Re: Helps with lot size in EA
Are you sure that the pips multiplier is correctly defined for pairs with 5 digits? That is a common error with invalid SL and TP.
-
Re: Helps with lot size in EA
Look, if you're starting out on MQL4, don't complicate yourself with dynamic batch logic as soon as possible. You better keep the lot steady until you understand how EA works in general.
-
Re: Helps with lot size in EA
I understand, but what I want to achieve is not so complex. I just want to increase lots in profit and restart with loss. I don't care about the rest of the EA, I just care about that logic. Believe in your analysis and keep the plan, don't panic with the moves.
-
Re: Helps with lot size in EA
I'd stop insisting on that crap code and start one from scratch, save you hours of frustration.
-
Re: Helps with lot size in EA
I recommend this approach: create a lastTradeProfit global variable, use it to decide the size of the next batch. You can save it to a GlobalVariable if you need persistence.
-
Re: Helps with lot size in EA
It's just what you describe, but be careful, it can be just as dangerous.
-
Re: Helps with lot size in EA
Brother, if it's already giving you stoploss mistakes, don't trust the backtest result.
-
Re: Helps with lot size in EA
What I find odd is that it only works in pairs with JPY. Have you checked the Point and Digits decimals? I could be miscalculating the values for that.
-
Re: Helps with lot size in EA
You're right, I'm using 0.01 for the minimum batch, could that be affecting the pairs without JPY? Believe in your analysis and keep the plan, don't panic with the moves.
-
Re: Helps with lot size in EA
Exactly. The minimum lot and the minimum SL vary between pairs. MQL4 does not give you a clear error, only fails silently if something does not fit.
-
Re: Helps with lot size in EA
An easy solution: use MarketInfo(Symbol(
-
Re: Helps with lot size in EA
Honestly, you need to clean up more before you ask for help. It�s not bad, but you�re skipping basic steps.
-
Re: Helps with lot size in EA
Brother, not everything that shines in Quant is gold. If you�re using FXPro Quant, get ready for a lot of debugging.
-
Re: Helps with lot size in EA
Another option: Use an external EA to manage the lot size and only signal your main EA. Divide and beat.
-
Re: Helps with lot size in EA
I didn't consider that idea. Do you know anyone who only manages lots? Believe in your analysis and keep the plan, don't panic with the moves.
-
Re: Helps with lot size in EA
Yes, look for "Lot Manager" in MQL5. There are several free ones you could adapt. You could even combine them using iCustom.
-
Re: Helps with lot size in EA
If you have to go to another EA just to do something so basic, your code has more holes than a gruy�re cheese.
-
Re: Helps with lot size in EA
Don't be too hard. We all start without knowing. The important thing is that he's trying to learn and not copy blindly.
-
Re: Helps with lot size in EA
I'm going to be honest: if it gives you basic compilation errors, it's not time to implement money management logics. First things first.
-
Re: Helps with lot size in EA
What if instead of doubling lots, you increase by fixed steps? It would be more stable and less risky. Type: 0.01, 0.02, 0.03... to a limit.
-
Re: Helps with lot size in EA
Good idea, with fixed steps I'd feel more comfortable. How do I implement it in the code? Believe in your analysis and keep the plan, don't panic with the moves.