Expert Advisors and Automated Trading - page 38

  Error 5040  (6)
Im getting Error 5040 since recent update on MT5 All program were working fine om previous build and my mt5 version is 4016 It includes CustomTicksAdd function
Hi, I'd like to add a symbol to an array when trade open on that symbol. I looked to ArrayFunction() and the only function to add value to an array is using ArrayFill but it is not supporting a string. I tried using CArrayString class but failed to understand how to work with it. From the
Hello dear developers. I ran into a problem when the customer's global variables are automatically deleted after restarting the terminal. Because of this, the adviser does not work correctly. But I do not have such an error, and I have not encountered this before. At the same time, we have the same
Can anyone please assist me on how to get the LOT-size changed utilizing ExpertMAMA?
Hi I tryed to show the value of moving averge, I used this: double maValueH4 = iMA ( _Symbol , PERIOD_H4 , 50 , 0 , MODE_SMA , PRICE_CLOSE ); double maValueH1 = iMA ( _Symbol , PERIOD_H1 , 50 , 0 , MODE_SMA , PRICE_CLOSE ); double maValueM30 = iMA ( _Symbol , PERIOD_M30 , 50 , 0 , MODE_SMA
Hello, Can someone come up with a mql5 code that would delete the new position if it is the opposite type/ trading direction from existing position? Thank you
SymbolInfoDouble(_Symbol, SYMBOL_TRADE_TICK_VALUE) in USDJPY get error results 100( it should be about 0.668 now USDJPY=149.5) in EA. But in script this function get correct result about 0.67, I think it's a bug recently, since it never exist in the past days
need an example of Print() to print out an datetime array, thanks    datetime time[50],time2[50]; Print(" time2[i]= %9d", time2[i] );      Print(" time2[i+1]= %9d", time2[i+1] ); i use above code , but it didn't show in the tester .log file~~ print...
Hi, I'm familiar with C++ and have done a few projects with it. I want to learn how to write a simple script that places and order (O1) with a take profit and stop loss, and then, based on the what happens to O1 to place an O2 also with a take profit and a stop loss. Thank you
//here is a snippet datetime low_date[ 10 ],high_date[ 10 ] ; // here i how it is fillled low_date[w]= iTime ( NULL , 0 ,index1) ; //Time[index1]; // If i acces the table with a definite index( for example 1 ) i get the correct dates but if i tried to access the datetime array within a loop
Hello, I cannot launch the MQL5 Debugger, I tried with script, indicator and EA but it still failed. Is that a bug
HI! I have an advisor that, while trading, frequently opens multiple positions in the same direction. The inquiry is: how can these various positions be consolidated? For instance, I currently hold 10 long positions of 0.1 lot each and 3 short positions of 0.2 lot each. What is the method to merge
Please where can I get a robot or a script that will open multiple positions based on the position I open myself. Say I open a position with 1lot and fixed stop loss and take profit levels, it just takes these parameters and open the same position on the same pair like 10 or more times.
Hi, I need to calculate a couple of variable such as lastOpenPriceBuy, lastOpenPriceSell, lastLotBuy, lastLotSell and also totalProfitBuy and totalProfitSell, to do that I create a PositionInfo() function. void PositionInfo ( string CurrentSymbol, ulong MagicNumber, double &
Hi all, I have a requirement where I need to run an EA on Account1 which does various tasks. At certain points the EA on Account1 needs to trigger actions on Account2. After looking around a little bit, it seems like: - I will need to run the code for each account separately in different terminals
Greetings, I am struggling to get rid of a panel's close button. The reason to do such thing is, I successfuly created a CAppDialog panel with a guide found on YouTube, and one of the buttons should wipe all the objects created by the expert so far, but since it is irreversible, I want a
Hello all, I am writing an EA in MQL5. I have Support and resistance lines auto detecting. When a support gets taken out, it will not detect at all the next time the code runs(it will receive a new bar). It should then delete the support line that was there before, but instead, it leaves it. Why
Hi All, I am attempting to write a function that limits the number of open positions held by closing the least profitable trades, I have written the code as below but am having trouble with the PositionClose() function, is there something I am missing here? CSymbolInfo m_symbol;
Hi all, I am attempting to write a function that cycles through open positions and closes all those that are in profit by x amount and then returns true, and would return false in the case where no positions have been closed, I have the following code which seems to be ineffective, could someone
double arr3[ 3 ][ 2 ][ 2 ]; arr3[ 0 ][ 0 ][ 0 ]= 1 ; arr3[ 0 ][ 0 ][ 1 ]= 2 ; arr3[ 0 ][ 1 ][ 0 ]= 11 ; arr3[ 0 ][ 1 ][ 1 ]= 12 ; arr3[ 1 ][ 0 ][ 0 ]= 111 ; arr3[ 1 ][ 0 ][ 1 ]= 112 ; Print ( "it is " ); ArrayPrint (arr3); I've created a 3d array and partially populated it. However I can't get
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
  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