Expert Advisors and Automated Trading - page 106

Hello, I am building my EA with the purpose of "not closing" positions in loss. When the Close Conditions are met : a) If the current chain of trades is in profit than close in profit. b) If the current chain of trades is in loss, than hedge the loss by an opposite position with volume = to the sum
The code: void FillArray(PosArray& C) { int total= PositionsTotal (); for ( int i= 0 ; i<total; i++) { CPositionInfo p; if (p.SelectByIndex(i)) { C.InsertSort( new Pos(p)); } Sleep ( 1 ); }
Hi forum, As per the title of the thread, if I have a standard RSI EA running that I'd like to run only between a certain period of the day, is there a nice easy way of doing this? What about if I only want new positions to be limited to a time-frame but closing orders may still work? What about if
Basically the title and if doesn't then how can I get the number of total positions opened in my account across all symbols? thank you
Hi, I tried to install the MetaTrader5 package and I'm getting the errors below. Is there any solution? Thanks. ERROR: Could not find a version that satisfies the requirement MetaTrader5 (from versions: none) ERROR: No matching distribution found for MetaTrader5
I am trying to develop a high-speed scaler EA. Let's say an EA tries to open a trade. Before the trade is recorded the next tick arrives. So the EA thinks the trade is not opened yet. Will the EA try to open the trade again, resulting in two similar trades? In other words, will the EA block until
I need EA who makes pending stop order and if price hit my stop loss i need that the EA make the same pending stop order at the same price that open at the biggining and if price hit my TP do not make any order also i will like the possible to include a manual open price to se and add a pip
Hi guys, need an advise. I use tickvalue for calculating lot size. Sometimes that piece of code returns zero: tickVal = SymbolInfoDouble ( Symbol() , SYMBOL_TRADE_TICK_VALUE ); tickVal = NormalizeDouble (tickVal, Digits ()); I'm using tickValue to calculate Stopp Loss pips risked: double Pips_Risked
Hey All, I want to run optimization algo for multiple currencies. To give example lets assume I will use QQE Histogram to buy or sell. It has following potential input values: input int qqeinpRsiPeriod = 15 ; // RSI period input int
Hello, I want to export MT5 optimizer results to Excel, surprisingly I am having problems achieving this outcome. Below this is my options, but the 'Export to XML' gives me unrecognizable code and certainly not what I am looking for in an Excel Spreadsheet. thanks for any advice, regards
Hello Traders, so far in my EAs it was only possible to have one postion in each direction at the same time. I am saving position attributes like "BuyStopDistance" in global variables. Now I am working on a EA which requires to have multiple positions in the same direction. To manage all positions
I wonder if there is a function enable me to shorten this conditions: if(High[i] > High[1+i] && High[i] > High[2+i] && High[i] > High[3+i] && High[i] > High[4+i] && High[i] > High[5+i] && High[i] > High[6+i] && High[i] > High[7+i] && High[i] > High[8+i] && High[i] > High[9+i] && High[i] > High[10+i]
Profits & all other Fields are not getting calculated for custom symbol in strategy tester.. I have uploaded the setting of my custom symbol Kindly help me how to set this thing up
Hi to all, I want to test an EA but depending of the value of an input, some other inputs should not be considered. How can I do that? I created a static list, and put a key to track the input tested but it seems this approach is not working. Maybe a better approach exists, any idea? Thanks
  EA CODE  (2)
i am asking for help if some one can help me with my EA am asking for a command line that the EA can be useing, if my floting profit/Loss reaches a profit of myabe 10$ then it closes all my open trade and be done for a day till the next day to resume
Hi everybody, like always and done without any problems in previous versions of MT5 I want to test my (unmodified) EA by the strategy tester. But since I've installed MT5 build 2926 I cannot open any pending orders. I get the error messages CP 0 16 : 18 : 13.970 Tester DE30,H1
First some context: As best I can tell, MQL5 can make use of events handled by the Terminal, but they python integration doesn't get or see those events. Mostly that's ok. I don't particularly care about the events themselves (because I can program in python to listen for anything that changes and
All good health. Help to calculate the deposit to copy the signal. To the signal provider deposit 3000 c.u. with a leverage of 1:500. Lots - 0.01-0.02-0.03, etc. martingale system. It is not possible for a subscriber to make a deposit of 3000 USD. There is an offer to make a deposit to a cent
Hello, My problem is that my new bought EA doesn't work on VPS because my VPS doesn't seem to be able to sync web request. I see a lot of error 5200. If anyone has experienced this issue before and have found a solution, I'd be thankful to know how
Hi all, I am writing a function to get the netting for a particular magic and symbol. But somehow I get a very minute amout (0.00000000000000004) at the end of the amount even though the answer should just be 0.3. Can anyone explain why's that happening? Here's the Position Data : Symbol Position
Hello, I want to make a simple sell but I always receive error. This is my code: bool cTrades::Sell( string iSymbol, double iVolume , string iLabel = "" ) { MqlTradeResult Result = { 0 }; MqlTradeRequest Request; Request.action = TRADE_ACTION_DEAL ; Request.symbol = iSymbol;
Is it just me and my environment, or is this a general 'problem'? I would not have expected such an ERROR from a call to determine if an object exists. Yes, I can reset the error after every call, but why should that be necessary? There seems to be a similar issue with call to GlobalVariableCheck
Hello, I used to update a trade panel everytick to show the current PnL of the trades. This results to have some problems and to Freeze the tick flow sometimes, randomly. I searched a bit and I found that is better to place a Sleep function or a timer to not call ObjectFind every tick. That's my
Hi, I have an EA which will close all open orders and positions in the OnDeinit function. This works fine if if I change the timeframe of the chart the EA is attached to. But if I remove the EA from the chart the OnDeinit function will be called; but cannot close the open orders and positions, the
Hi I have been trying to modify this bit of sample code for use. I keep getting the Invalid Price error. Does anyone have any ideas Thanks double volume= 0.1 ; string symbol= "GBPUSD" ; // specify the symbol, at which the order is placed int digits=( int ) SymbolInfoInteger (symbol
Im looking for a freelance developer to chat to before posting an order. I need some information about the availabilty to create EA according specific requirements
Hello i am copying signal i have enabled auto trading , and showing signal logo in my Mt5 . ( full signal provider history and runing trades can see in Mt5) but when i open mql5 website and trying to see histroy and runing trades from my sisgnal provider its showing Enable copy trading in the
This was my previous problem https://www.mql5.com/en/forum/435434#comment_42935818 which has been solved However, a new problem emerged that i'm needing help with. When i load my EA onto a chart, immediately within seconds i get a email of the info i wanted to receive, but after that first email
[Deleted]
Dear Members I am stuck as how to initialize member array of a Class with fixed values in constructor method. please help me out. //+----------------------------------------------------------------------------------------------------------+ //| CLASS: CFibonacci //| APPLICATION: to define
I'm writing an EA using mql5. It works fine when I use MetaQuotes Demo Account but when I switch to my brockers' demo account. It throws an error message in the journal when it opens positions: 13:00:12.294 Trades '45767': failed market buy 10 EURUSD sl: 0.99529 [AutoTrading disabled by server]