You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
orderopening before opening a trade make TicketNumber = 0; otherwise your checking if a new trade opend is senseless
and some other things i can suggest
Following your suggestion no the EA is opening buy and sell orders, and it's closing them normally,
the only problem is that is loosing money :-D
this is the EA, it's missing a good managing, I'me using only the PRICE_OPEN cross with EMA1 at 9 days
You made it now a 2EMA cross
With 3 EMA lines you could follow the instructions of WHRoeder
about changing signal next tick you were using Price_Median
that is (High+Low) / 2 so changing signal on next tick is almost not happening
if your close rule was ok
this is how a chart looks like with 3 ema price_median periods you started
easily to see moments start EMA1 < EMA2 with EMA2 < EMA3 or moment EMA1 > EMA2 with EMA2 > EMA3
if you follow that in coding
then it could be your code is gonna look like .....
Is that necessary? If OrderSend succeeds, TicketNumber will == the ticket number, if it fails, Ticket number will == -1.
Your right about this
Only you get then people gonna do easily
TicketNumberBuy = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage*pips2points,0,0, "EMA_CROSS", MagicNo, 0, Green);
OrderClose( TicketNumberBuy, OrderLots(), OrderClosePrice(), Slippage*pips2points )) // you easily loose that value ( restarting pc )
and you can open only one buy that way...
with loop and orderselect it is not needed to know ticketnumber of your trades
after this simple EMA cross indicator and EA, I'm trying to translate in MQL4a type of Dorsey indicator,
I've trouble to use the iLow for select the low and lowest value of an array of a variable PB values.
after this simple EMA cross indicator and EA, I'm trying to translate in MQL4a type of Dorsey indicator,
I've trouble to use the iLow for select the low and lowest value of an array of a variable PB values.
iLow() ? have you read the documentation at all ? so your Symbol is 9 your timeframe is PB and your shift is 0 ??
symbol has to be a string, so 9 won't work, the timeframe has to be an int so PB won't work . . . 0 as the shift is OK
By the way, PB is not an array . . . you do have one array, BU and it's an int which you give double values . . .
. . . do you know what PRICE_CLOSE is ? it's zero . . . click here ---> PRICE_CLOSE
You need to read the Book . . .
iLow() ? have you read the documentation at all ? so your Symbol is 9 your timeframe is PB and your shift is 0 ??
symbol has to be a string, so 9 won't work, the timeframe has to be an int so PB won't work . . . 0 as the shift is OK
By the way, PB is not an array . . . you do have one array, BU and it's an int which you give double values . . .
. . . do you know what PRICE_CLOSE is ? it's zero . . . click here ---> PRICE_CLOSE
You need to read the Book . . .
instead of PRICE_CLOSE I need the Close price of the actual bar, and about the iLow function I've wrong the order of the fields,
I read bettere the book for modify the iLow, the PB into an array and for sostitute the PRICE_CLOSE with EURUSD Price on the Closed last bar.
I'm reading all the documentation about the arrays and about the array sorting,
the problem is focused into the "finding of the lowest and higher value of the last 9 values of the variable PB"
I understand that MQL give me parenthesis error because can't calulate the line:
this the error of compiler
'\end_of_program' - unbalanced left parenthesis C:\Program Files (x86)\XM MT4\experts\indicators\A.mq4 (59, 1)
You are using the buffers without [ ]
Does this default to [0] or not work?
You are using the buffers without [ ]
Does this default to [0] or not work?
it's giving me the same error also with [0]
it's giving me the same error also with [0]
You still haven't read the documentation for iLow() . . . the first parameter is a string and is the Symbol, what symbol is PB[0] ? PB[] is a double not a string . . . do you understand why this is never going to work ?
This is where your missing bracket is . . . all you need to do is count them . . .