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
[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]
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
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
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
If you do not have an account, please register
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.