Expert Advisors and Automated Trading - page 125

To post a new topic, please log in or register
Hello, Im trying to understand trade function in the Ctrade class. I don't get what is the difference between the Buy function and the positionOpen function. I mean a Buy is to open a long position,  so for what is positionOpen? Thank you.
Weird behavior here. CiLow.GetData( 0, Bars( _Symbol, _Period, initialTime, TimeCurrent() ), buffer ); The previous call, when run in back tests, returns a buffer with n elements, where the first of these elements is the low of bar at initialTime. However, the same call in a demo live account...
How do you set a range? To be used as a condition. Specifically a datetime variable that has a a time range.
Is it possible for an EA/script to save ALL chart templates that are open in the terminal? I know the chart operations are available but how do I search for the values of the chart ID's that are open? If I can pull a list of the open chart ID's can I use ChartSaveTemplate to reference each...
Hi, I'm used to thinking of currency trades in USD notional exposure (i.e. 100,000 lots of TRYZAR would be 28,400 USDZAR) And USD would be my deposit currency. Is there an easy way to get USD exposure (or deposit currency exposure) from FX orders in MQL4? I've had a good look at the Order functions...
Hi, I'm using MT5 build 1627 and I noticed a potential bug. When using the iCustom-function on a different timeframe within an indicator, the result is always 0. For demonstration, i put the following code into a script: //+------------------------------------------------------------------+#property...
I have got an EA that opens order at signals . It is working with Moving Averages , and opens 2 orders at the same time . The first EA opens the first order and the second EA opens the second order BUY_STOP or SELL_STOP with the previous order .  When opening the second order , the Modify Order EA...
  Magic number (7)
Hi, if I remove the magic number in the EA settings will the EA manage a trade I take manuell?
Hi I have a problem about the part of trading in my EA testing. Journal in testing centre shows: 2017.07.18 13:43:13.967 Core 1 2017.06.26 00:00:00   failed market buy 0.10 EURUSD sl: 1.11701 [Unsupported filling mode] my code of trading request is :" BoRequest.type_filling = ORDER_FILLING_IOC  ",...
Hi, I reently migrated from MQL4 and right now I can't find the right sintax for retrieving specific prices. I wrote the code below, which produces the error message: 'PRICE_HIGH function not defined' (the same for all the other ones). I was expecting PRICE_HIGH to be equivalent to iHigh from MQL4,...
Using OrderSendAsync to quickly send several orders, passes the same order twice to the OnTradeTransaction event handler. Consider this EA example, which uses Trade\Trade.mqh to place 5 Buy Stop orders #include <Trade\Trade.mqh>#include <Trade\SymbolInfo.mqh>int OnInit()  {   CSymbolInfo si;...
Hey, have been looking around for an EA that has a break even for the whole account closing a negative position with open positions. The EA works only according to open positions Example - if a position reaches -$4.5, then the EA looks for open positive positions on the account that will cover the...
Hello, please i am looking for a way to click any part of my screen with x and y co-ordinate, i have seen the PostMessageA function but i can only find commands that affect the MetaTrader platform i will like the click to affect the window on display, if my browser is showing and the EA clicks, it...
  About trailing stop (16   1 2)
Can anybody please upload a code section on how to modify a position e.g. trailing stop. I tried different variants and it does not work. Please help. Thank You.
Hello I own this robot mt5 forex robot and have dealt with a company WVC But when you open an account with a company FXDD Start opens up losing positions and closes trades below the point I want this robot to set a profit two or three points Does anyone know the settings of this robot Presently pay...
Hello, Have been running an EA on USDCHF/EURGBP/USDJPY/EURJPY/USDCAD/GBPJPY since 26/6/16 logging results on Excel daily. Total gain for above currencies is £147.82 (26/6/16 - 16/7/17). Actual data - demo account. Ran a backtest for each currency and total for period 26/6/16 - 16/7/17 shows a loss...
Hi guys, I want to make indicator to print on chart the price when yesterday Europe session close. (I mean to print close price around 18.00 (mine is GMT+2) of previous day) Now, Im stuck at getting the closing bar and put them to them program. Any help? Thank you guys :)
is there a code to execute (especially test) an EA at certain (user defined) intervals  of incomings ticks instead of each tick (with OnTick)? for hints, thanks in advance
Hello, Im trying to understand ObjectCreate function for couple of days now. I just don't understand the 2 or more last parameters: priceN and timeN. What are they?  At the beggining I thought that the are the coordinate of the object but then I saw the:OBJPROP_TIME,OBJPROP_YDISTANCE,OBJPROP_XSIZE...
Hi, I am trying to create a custom indicator which uses tick data (Ask and bid price) to show it as a graph in a separate window. How can I plot the values of historical tick data and keep adding to it the new tick data at real time? I am using OnCalculate function to get the current tick data but...
I could have sworn I saw in the notes from a recent release that function pointers had been added to the language, and now I can't find it anywhere. I didn't imagine this, did I? ‌‌Thanks!
does anyone have the idea for a (complete)code part, which makes sure, an EA (alternatively) an indicator is executed only at certain time intervals, let's say every 30 seconds etc.? for eventual hints thanks a lot in advance
Hey all newb here again Using a hedging account, I want to open an order when at an EMA cross with stop loss and take profit. I also however, want the order to close if the opposite cross happens before a stop loss or take profit has been triggered. About 8 hours into this problem and I'm lost as to...
dear members, can anybody help or suggest me the most profitable e.a. for trading in markets, maybe grid e.a or any scalping e.a, with less drawdown
Good afternoon! Does anyone help me find my mistake here? It compiles, but does not separate the orders according to the ENUM: Buy, Sell and Buy_Sell ... In the 3 configurations it buys and sells ... //| Class=CPriceAction...
I need an idea (or a piece of code to starts it), about making my EA open an order if it catches de stop loss level, in the new direction. Coudn't find anything that helps on my searches. Thanks in advance!
Hi I am confusing in coding a simple EA, plz help The problem is : If a fast MA cross a slow MA that produce a golden cross condition, then I want it to buy when the tick(price) equal or below the slow moving average value after confirming the golden cross condition, and if the price does not equal...
Ok so I stared experimenting with EA's and testing and so on. I understand the basics of programming and realize that if this was written in OOP style it would be a bit easier to navigate. However, I just wanted to start out and see if I could get an EA going with all the parameters I'm after. It's...
hi all, i'm trying to create my own expert adviser. However, i don't know the coding (mql5) that for close the opened position by (OrderType() == OP_BUY) or (OrderType() == OP_SELL). It is so much different with mql4. Kindly share a sample coding (mql5) for the below situation. if condition A, then...
Hi there, I have installed a few EA into MT4 and then drag it to the chart to let it start auto trading to try some demo. I can see a smiley face at the top right hand corner but i opened it for a few days, there is no single trade done? Why is it? I have no touch any setting and just want to see if...