Expert Advisors and Automated Trading - page 121

Hello, Quick question on good programming practices. I have a trade entry manager EA which, after the users clicks to buy/sell then tries to immediately select the ticket number (which was captured during the market order entry process). Sometimes, the EA selects it successfully (open position) with
I'm new here so sorry if this has been asked over and over. This is my literal first 5 minutes on here and not sure how to find what I'm looking for. But I'm wondering <Deleted> . <Deleted> Thank you kindly for your time
I am backtesting an EA and got an unexpected loss in my backtest results, so I tested using the Strategy Tester Visualization using the exact same data, period and parameters and the trade that leads to the loss isn't taken on on the visualized version. Is there some difference in the way the
Hi, Sometimes, when I manually change the symbol on a chart, there's a delay between the moment the chart loads from the saved cache and the moment it updates its rates info and prints the new ticks/bars received from the server. This is rare but sometimes the delay is long enough that it results in
Please see subject. One of my brokers only provides MT4 but I have an EA built for MT5. Is there any way to use the MT5 terminal and connect to an MT4-only broker? This kind of "backward compatibility" wouldn't be odd for many systems, but I have no idea. If someone also knows how this is possible
I got my big issues with CDialog worked out thanks to Manuel Alejandro Cercos Perez -- appreciate the suggestion Manuel! A nagging issue is that when I click on a button on the dialog, if I move the mouse at all while clicking, it scrolls the chart behind it. Similarly, dragging within the body of
Hi, I've got different settings associated with each timeframe in MT5 so I set them up in an array like this: // timeframe specific settings double timeframe_vars[][ 3 ] = { { PERIOD_M1 , m1_setting_1, m1_setting_2}, { PERIOD_M2 , m2_setting_1, m2_setting_2}, ... {
I have 30-40 hours studying and partially resolving this problem through ways that are not solving the problem, but trying to avoid it and/or reset it, with moderate but not complete success. Anyone with experience dealing with nuances of instances of CAppDialog (combined with CChart etc.) Please
Can anyone help me with adding a 'percentage risk' code, to add to an EA that I am using
Goodmorning and Sorry for that question: I would like to autoindent newline, at the Moment if I Press enter when I'm under a function or a loop or somethings like that, new line Is not indented but starts at the beginning of the line. How to solve that? Thank you and really sorry about this easy
  Freelancing not an option.  (16   1 2)
Hello all, I am new to MT and looking to automate a strategy for MT4. Freelancing is not an option because there is no way to verify whether a developer can build it. The platform locks the money until it is done and could be locked forever. Thank you
Hi all. It is my understanding (please correct me if I'm wrong) that I can follow the instructions here to build the equivalent of an EA in python instead of MQL5, calling the python functions on that documentation page to handle all the broker interaction, and all the other logic and calculations
[Deleted]
void OnTick () { int HC3 = iHighest ( NULL , PERIOD_D1 , MODE_HIGH , WHOLE_ARRAY , 0 ); double HC33 = High[HC3]; double BearMarket = (((HC33-( SymbolInfoDouble ( Symbol (), SYMBOL_BID )))/ HC33) * 100 ); } Trying to find if the price is in a bear market on the daily chart while looking for
Is it possible for an EA/script to save ALL chart templates that are open in the terminal? I know the chart operations are available but how do I search for the values of the chart ID's that are open? If I can pull a list of the open chart ID's can I use ChartSaveTemplate to reference each...
I have an EA in which i need to get the result of the latest deal, to see if it closed in profit or loss which works perfectly in a graph, however, when running the strategy tester, as soon as it reaches the code to check the deal history the tester permanently freezes. The code only runs once
Hi, My orders go through almost all the time but one order did not overnight and the only thing it says is Request rejected. Along with a retcode of 10006. It doesn't offer anymore details on it. I just tried another order and it went through fine, so I'm a little puzzled by this? I recently went
Hello, I am writing a code to close trades when Account Equity is greater that Account Balance. My target is to reduce risk for another martingale EA. so I exit at neutral point (No Loss / Profit) after the EA open 5 trades or more. My question is: is there is any way to close orders based on the
Hello Community :) This is my first Topic here so i come for help .. I know there are some guys here who are very advanced . The problem i face is i couldn't compare if Macd main/signal line is above/below Momentum . I can't write .. "if(iMomentum>iMACD) " Because as you know each indicator...
Hi, My OrderSendAsync returns true (sent ok) but the order isn't executed. I suppose this is because of request.deviation (because if I put a higher value, then orders are executed). How can I determine, for sure , that my orders are rejected because of a request.deviation that is too low? Thanks
Maybe I am not using the right search terms in google or on this forum (if so, please enlighten me so I can find the golden key). I cannot find easy solutions to aligning my timezone with my broker's timezone in the strategy tester ... and take into account DST. So, I kludged my way through it as
Hi, I have tried several panels to help me react faster than the buy and sell option built into MQ5, but regularly, the panel does not respond anymore, I am forced to delete it and add it again to be able to use it... and I don't know why, I have tested without putting any indicators, only the panel
Is it possible to create a drop down menu that shows you available pairs and changes an indicator's values depending on what pair you pick from the EA settings drop down menu? Would that be variables? I haven't even tried messing with variables yet as I don't understand what that's about. I only
Hello Guys Regarding with my scalping strategy, in very short time I am looking for script to close all order whether it profit or loss... with one click.. Thank you
Hi there, I've tried to build a notification following the MQL5 guidelines, that's something like this: string CC= StringFormat ( " [" ,CustomComment, "]" ); string PTC= StringFormat ( "Positions to close: " ,TC); string LS= StringFormat ( ", loss: "
Hi, I want to activate trailing stop loss for my trades in MetaTrader 5 using Python, however, I cannot find any built-in function in MT5. Do you know what I must do? Thanks
How do I make an EA to trade exactly the same on "open bars" and "Every real tick" settings on history? I did create a function that only allows the EA to trade on the first tick if (iVolume(Symbol(),PERIOD_M15,0 )!= 1)return; But I get a diffrent equity graph than when setting the settings to
  Moving Average  (8)
``` void OnTick () { //--- double MA[]; // array for iMA indicator values //---- handles for indicators int MA_handle; double open = iOpen ( NULL , 0 , 0 ); double close = iClose ( _Symbol , PERIOD_CURRENT , 0 ); double Ask = NormalizeDouble (
As the title suggests its supposed to only fire of a single trade per candle. Im guessing my loops have an issue or something I disregarded. Can someone with fresh eyes kindly assist. #include <Trade/Trade.mqh> #include <LotSizeCalc.mqh> //enum IndexList{BUY=1,SELL=0,}; //input IndexList PROGRAM =
  Closing graphs  (8)
Hi; anyone know how close all graphs at same time? tks
Hello, I am new in MQL5 programming language and creating a simple expert advisor . The problem is I've placed an order and then modified using Stop-Loss and Take-Profit. But I want to remodify my Stop-Loss and Take-Profit for the same order on specific market condition. But I can't do that. It's