Forum

How to turn an EA into Universal EA?

Dear Community, I would like to know what makes an Expert Advisor to be universal (to attach on one chart and trade all symbols)? for the following code: #property copyright "Copyright © 2011, Krzysztof Sosnierz" #property link "" // Current counters int market = 0 ; // Previous counters int

Close open position with expiry from pending

Hello, i have next code and as title says i would like to have the expiry from pending to be used for the open position. eg.: I open pending at 2:15 with expiry at 3:15. If position will be open at 3:14 i would like to be close at 3:15. void ClosePosition() { int ticket = OrderTicket(); {

OrderOpenPrice from pending orders

Hello, I would like to know if someone can help me with ideas about my next problem: I am opening a pending order at 1:30:00, after 30 min at 2:00:00 it will turn to sell/buy. I have the next code to close the position after 10 hours, it will use OrderOpenPrice from sell/buy position not from my

What's the difference between

Hello I have 2 codes, that look almost the same but the results on backtest are 100% different. Can somebody tell me what is wrong with 2nd code because that is the one that is broken. 1st code: int start() { double MA_1_t= iMA ( NULL , 0 ,FastMAPeriod, 0 , 1 , 0 , 0 ); double MA_2_t=

Take a double from .txt file

Hello, I would like to know if there must be a change in a line in this code ( https://www.mql5.com/en/forum/117683 ). I would like to change the integer number to double, and how can I call a number from that file later in my EA, if I do not know its position, and I would like that number to be

Compare Prices

Hello, I was thinking to solve the next problem: If last price=Bidprevious and actual price=Bidcurrent, I would like to know when Bidcurrent=Bidprevious+(n*pips): ex: Last price=1.4000 Current price=1.4005 And I would like to open trade only when the actual price will be 1.4010. I tought

Boolean Question

Hello, I have a question if I have something like this: if (condition) { Bool x= true ; for (int i = (total-1); i >= 0; i --) {if ( OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) if(OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber) if (condition1) continue;

Break within open position

Hello, I was thinking if there is a way to code something like : 1st position is open at 1.3000 2nd position must be open only when the price reach 1.3004 3rd position only at 1.3008 I was thinking to use: "case 1 at 1.3001 no order send with comparedoubles1" "case 2

EA question

I would like to know if there is a code for not opening another long position on a price that already has a long one open. And if it is possible for tick chart also. *edit: For ex: Moment 1: Price 1.3200 // I will go long M2: Price 1.3190 // I am waiting M3

compare tick1 with tick 0

Hello, I would like to know if there is a way to compare tick1 with the previous one tick0. And if there is one, could you help me with a point from where should I start to code this one? Ex: Suppose every tick change every sec, at 00:00:00 will be tick0:1.3000 and at 00:00:01 tick1 will be 1.3001