Expert Advisors and Automated Trading - page 168

To post a new topic, please log in or register
When I make deal, then I know (risk) sum of money what I can loose (in program (OrderCalcProfit()) that is Profit with minus of course). But when I want to put that sum in EA I need StopLoss Price. I thought I can calculate it with cycling: double CalculateStopLoss(double Price_Open, double Side,...
I wanna connect my EA to an ORACLE XE database. Does anyone have any experience belonging to this? Does anyone have an idea to solve this issue? Or is it just solved? If it is possible I don't wanna handle with java. What about OCILIB? http://orclib.sourceforge.net Is it possible with it? What...
Why in Strategy Tester ChartSetInteger(ChartID(),CHART_EVENT_OBJECT_CREATE,true) returns false with an error code 4211 (ERR_CHART_NOT_FOUND)?! Not in a tester it's all good an working. Does it mean we can not use CHART_EVENT_OBJECT_CREATE in MT4 tester (v.4.00 Build 765) ? Here is the piece of...
Is there any way how to define function like "Print" in order to pass a number of variables? I'm advanced in C, but I can't see any option how to do it in MQL4. Is it possible?  Thanks in advance :) 
I was wondering would I need a buffer if I was creating trend lines and deleting them when price touches for example I have 4 lines for 2 high points and 2 low points between 30 candles. if all lines were created and price touches line 3 and it deletes how can I make line 3 create a again but on the...
There was recently an interesting topic on Russian forum, where the discussion started from a poll on the quality of code produced by freelancer to finally shift to a discussion on the best way to retrieve the name of a timeframe (as s string) from its mql4 value. The big divergence start from the...
Hello everybody, Does anybody know why the limited timer resolution of metatrader is about 15 milliseconds ? For example this code return an average gap of 15 milliseconds : int OnInit(){ EventSetMillisecondTimer(1); return(INIT_SUCCEEDED); } void OnTimer(){...
Hi guys, can anybody explain, what that sudden error is supposed to mean? My EA was working flawlessly for months, but since the latest update, I get this error. In my EA I just declare an array CMoneyManagement mms[]; and CMoneymanagement has one static variable. Whats wrong with that...
Hello. Anyone who could help adding wav sound for PlaySound? Thanks.
My question is, is there any way of having chart events in strategy tester? I'm trying to create a order management panel, but when I open up to strategy tester the Chart events aren't being processed. I tried it with a simple EA of just having a print statement in the OnChartEvent but nothing got...
Hi I'm getting error during testing new strategy related to Moneyfixedlot. Someone would be able to help me out ? I have look it up and unfortunately, I was not able to find how to fix that. "CMoneyFixedLot :: ValidationSettings: 1.000000 to 1000000.000000" I have tested many EA- some of them, I...
Hi guys , Please i need help with contents for my Heiken Ashi candles EA . I have the functions below, HA1=iCustom(Symbol(),0,"Heiken Ashi",1,i); HA2=iCustom(Symbol(),0,"Heiken Ashi",2,i); HA3=iCustom(Symbol(),0,"Heiken Ashi",3,i); HA4=iCustom(Symbol(),0,"Heiken Ashi",4,i); I want to know the...
I run my EA on a VPS. Today, USDJPY orders closed by the EA at the non-existent price. This is not a small amount. How this happen?    https://www.mql5.com/en/charts/3070874/usdjpy-h1-fbs-inc-this-trade-make-me-loss-how-this-happen 
Hi, everyone.     I'm almost new to mql4 programming but I have been around programming some time in other languajes. I'm trying to code an EA that runs at once several Strategies but I found a problem when coding, as all Strategies use the same program but may have different parameters, when I...
Hi all, I contracted a programmer to code an Ea that failed to work well because the EA was loaded in a folder that was not same location as the folder the developer loads the EA.His MQl4 folder is located under the FBS folder(as attached below) while mine is located under the open data folder of...
I'm coding an EA and I have a margin check within my EA to make sure I have enough margin to enter a trade. But for some reason I always get an insufficient margin, and I have no idea what's wrong. Here is my code: //checks if we can send the order based on margin levels.bool...
Dear developers! I continue to get the error "wrong timeframe request in Open Prices testing mode". All the testing is provided in "Open prices only" mode EXCLUSIVELY on M1 timeframe. I actually test the EA, in which timeframe of the loaded custom indicator is set as an input parameter. Because I...
Hello, sorry to annoy you with beginner questions, but believe me when I say I've tried for 2 days straight using google... I've switched from MQL4 to MQL5, and I'm surprised how hard it is to even have my EA make a trade. Can somebody tell me what I'm doing wrong here: I filled out my "...
void updatePosition(const MqlTradeTransaction& trans, double& iPosition)  {   printTradeTransaction(trans); if(trans.type == TRADE_TRANSACTION_HISTORY_ADD) { printf("TRADE_TRANSACTION_HISTORY_ADD detected"); printf("PositionSelect(Symbol()) result: %d "...
hi, can anybody give me advice on what historical data should i rely on? i have developed simple EA and backtested it on my brokers historical data. Results were not that bad, but i was confused about data i used - M1 chart is only available for 1 month past so i presume M5 is used to calculate...
Hi everyone! I am newbie in 4rum. I want create a EA auto order at fixed time. ex: server: Day 1: 01:00 > EA order buy or sell with SL, TP, size 0.01 If hit SL Day 2: 01:00 > EA order buy or sell with SL, TP, size 0.02 >>> hit TP return Day 1 If hit SL Day 3: 01:00 > EA order buy or sell...
Hello i want that there is stop from 5 minuten after my first alert (repeating), can somehelp me? This is my code where i think i need to put it? if(ArrowsBuy[0] != EMPTY_VALUE)   { if(AlertsOn)      { if (AlertsOnCurrent) int...
I need to test my EA with Strategy Tester. I am using iBands in my EA, but Strategy Tester cannot find that indicator. When I run that script under Demo Account all works well. What I must do for eliminating that obstacle?
Hi guys below is a code for a simple moving average add to chart expert. How would I change the colour of the indicator from the code??? What if I had several indicators such as bollinger bands, momentum in a sub-window and two moving averages what would be the easiest way to change the colour???...
Hi, 3 days I can't use the cloud agents. Is it coming from my own ... ?
I've been learning mql5 & OpenCL for some time. And I met a problem with OpenCL devices in the strategy tester. When I start MetaTrader5 on my PC. I can see the following log message in the "Journal" toolbox: 08:22:15.089    OpenCL    Device #0: CPU Intel(R)...
Option to show average holding time for trades...where can I find that? regards
//+------------------------------------------------------------------+ //| ExpertMAPSARSizeOptimized.mq5 | //| Copyright 2010, MetaQuotes Software Corp. | //| http://www.mql5.com...
Script has developed some trades together several pairs, each pair a different magic number ?
I'm working on an EA, and I want to compare the current market price to the price from 30 or 90 seconds ago.  Is there a way to get this info from MarketInfo? Or does my EA need to record prices and timestamp them?