Expert Advisors and Automated Trading - page 48

When the following Expert is initially attached to a chart, The SpinEdit value 25 is displayed. If the timeframe is changed, the value 25 is no longer displayed. However, clicking the up/down arrows will re-display the value. Changing timeframes again will hide the value. Is there a way to keep the
[Deleted]
I have an expert running , how can i call its functions from a script without the #import. Expert: void MyFunction(){ Print ( "Hello" ); } void OnInit (){ } void OnTick ( void ){ } Script: void OnStart ( void ){ //Call MyFunction here ... }
Hello, please can help code now work with stop loss and take profit #include <Trade/Trade.mqh> CTrade trade; input int InpFastPeriod = 14 ; // Fast period input int InpSlowPeriod = 21 ; // Slow period input int InpStopLoss = 100 ; // Stop Loss input int InpTakeProfit = 200 ; // Take Profit
[Deleted]
  Bar Time in seconds  (13   1 2)
How can i get current bar's time in seconds Comment ( TimeGMT (), " " , " " , TimeToString ( iTime ( NULL , 0 , 0 ), TIME_DATE | TIME_SECONDS )); TimeGMT works fine but i want to get bar time in seconds output
Hi, There's a way to iterate over all indicators to remove them all? Thanks
Hello I am getting into a discussion if the above is possible. I am not talking about the option "All Symbols in Market Watch " but instead running iteration of the various inputs on different symbols (on a single-symbol EA) with the Symbol being one of the things changing in each pass. The purpose
#include <Expert\Expert.mqh> MqlTick last_tick; MqlTick tickarray[ 2 ]; double last_bid = last_tick.bid; double last_ask = last_tick.ask; int openpositions = PositionsTotal (); bool levelcheck(); double bsl = last_ask - 150 * _Point ; double btp = last_bid + 300 * _Point ; double ssl = last_bid +
my EA places buyStop and sellStop orders when certain criteria are met after so many trials and errors, i realised the validation does not pass this line of code double ask = SymbolInfoDouble ( _Symbol , SYMBOL_ASK ); double bid = SymbolInfoDouble ( _Symbol , SYMBOL_BID ); int stopLevel = (
Hello Folks, I assume that its a quite easy question for you but I need your help. I got a website where I want my future EA clients to but their AccountIDs for a license Check. When I call the API via Postman I get the data, however I am unable to adapt the Webrequest() function accordingly to get
i have an EA that trades 9 pairs the strategy works best for different timeframes for each pair it has been indicated in the code to use the specified timeframe for each pair when i run the code in the tester with visualization on, i can select any time frame in the strategy tester menu and the code
Hello every one need help i created a function to calculate lotsize and to risk a certain percentage of account balance i have tested the the function on currency pairs and it works perfectly but when i try to use it on boom and crash indices it fail to calculate lot size and i get an error in the
Hi, im trying to set an SL price below the candlestick low. Ive tested everything separately and it all works yet currently the SLinPips printed for JPY pairs are inaccurate. input double sl_extras = 1 ; //pips string symbol_loop[] = { "GBPUSD" , "EURJPY"
Hi there due to my expert it's not getting profitable due to spend on commissions my question is the following: How to save on commissions by using PositionCloseBy? Made a test by using this code but it's not working the same as the original version (less profit): int OrdersCount= 0 ;
Hi everyone, I'm new in MQL5 and the following code is not working for me, what I want is that when it detects the crossing of the two H1 moving averages, I change the period with ChartSetSymbolPeriod to M5 and place the purchase order (orderSend) and close the purchase (orderClose or trade
  Memory Exception  (16   1 2)
Hello. I'm having a problem with my EA. I have the following message repeating: 2022.07.06 13:11:46.206 MemoryException 1228800 bytes not available, 0 heapmin result 2022.07.06 13:11:46.206 MemoryException 1228800 bytes not available, 0 heapmin result 2022.07.06 13:11:46.207 MemoryException 1228800
hi everyone I am looking for a free expert advisor who can open and close positions with keyboard shortcuts please? I would like to have a base so that I can modify it for keyboard shortcuts. Best Reguards, ZeroCafeine 😊
I keep running into this error at the automated validation testing: test on EURUSD,H1 (netting) strategy tester report 606 total trades test on XAUUSD,D1 (netting) 2018.06 . 25 01 : 34 : 00 failed exchange buy 0.20 XAUUSD at 1271.980 sl: 1271.480 tp: 1272.480 [Invalid stops] 2018.06 . 27 01 : 00
Hi, is there a way to log additional metrics during optimization? I would like to collect more information about an optimization run and to sort the results by these additional (non optimized) metrics. More precise: I woul like to have a nother column "MyMetric" after the "Sharp" Column. Is it
Hello Everyone I have a problem in optimization passes. I've searched a lot but non of questions nor the answers in the forum was the one solving this problem. The problem is that i have some bool parameters in my inputs which when they are set as false there is no need to optimize some other
Hello Everyone I have a problem in optimization passes. I've searched a lot but none of questions nor the answers in the forum was the one solving this problem. The problem is that I have some Boolean parameters in my inputs which when they are set as false there is no need to optimize some other...
  RSI EA problem  (3)
HI everyone today I coded this ea and it works but I've a problem with the buy positions, when opening a buy positions, the ea close it at the next bar! please help me! #property copyright "Copyright 2023, MetaQuotes Ltd." #property link " https://www.mql5.com " #property version "1.00"
Hello Dears First of all, I must say that my English is very poor and I wrote this text with Google Translate. If you see any mistakes in my text, I apologize in advance. ----------------------------------------------------------------
Hello, good day programmers, I have tried to eliminate the arrows and trendlines from the autotrades but they are only removed from the current chart but not from the other charts opened by the strategy tester. and in the same way when I call the function in the OnDeinit() part they are not
  Symbol Equity  (4)
Hello, I want to calculate the equity for each symbol separately, but my current code calculates the overall account equity instead. For instance, if my trading bot handles multiple currency pairs, and I only want the equity for the EURUSD pair, what code should I use? Can someone assist me in
Below is a code that creates 2 bitmap object. These objects gets resized accordingly whenever there's changes to the chart ie slide, zoom. You will see those objects flickering when you slide & zoom. Thanks! #property copyright "Copyright 2023, MetaQuotes Ltd." #property link
I have a script letting user to customise the chart properties. I use ChartSetSymbolPeriod to change the chart timeframe. my last input in the script is to save the template. problem is ChartSetSymbolPeriod causing the script to be terminated and then I recieve error in applying template. How to fix
Hello everyone, I hope you're doing well! I am currently working on developing an Expert Advisor (EA) and facing a challenge. I need to obtain the ticket number of the last position immediately after opening it. I am using the following code for this purpose; however, I am encountering inconsistent
Hi all, is there any way to access the built-in economic calendar during backtest? I tried CalendarValueHistory and while it does give proper results when executing the code on a live chart, it returns no results during backtest. Thank you in advance
I love MT5 but there are some problems that does not allow me to switch from MT4. 1. The spread in the backtests comes from the data and we cannot define a value. We know that spreads change a lot from broker to broker and having a fixed predefined value does not allow to test certain strategies and...