farrokhfa:
I want the EA to place two opposite pending orders in order to what I put below but it makes the same order type in YELLOW or RED case. For example in the RED case the EA would place SELLSTOP(1.2) & BUYSTOP(0.7) not BUYSTOP(0.7). Please help if know my mistake.
Are you sure ?
if (type == OP_BUY && level < MaxCycleLevels) { SetOrder(OP_SELLSTOP, 1.2, sl, 0, sl- 0.0005, Time[i]); SetOrder(OP_BUYSTOP, 0.7, sl, sl-0.0005, 0, Time[i]); } if (type == OP_SELL && level < MaxCycleLevels) { SetOrder(OP_BUYSTOP, 1.2, sl, 0, sl+ 0.0005, Time[i]); SetOrder(OP_SELLSTOP, 0.7, sl, sl+ 0.0005, 0, Time[i]); }
angevoyageur:
Are you sure ?
angevoyageur:
Sorry. For example in the RED case the EA would place SELLSTOP(1.2) & SELLSTOPSTOP(0.7) not BUYSTOP(0.7). Please help if know my mistake.
Are you sure ?
farrokhfa:
Sorry. For example in the RED case the EA would place SELLSTOP(1.2) & SELLSTOPSTOP(0.7) not BUYSTOP(0.7). Please help if know my mistake.
Don't you see I already answered ?
Sorry. For example in the RED case the EA would place SELLSTOP(1.2) & SELLSTOPSTOP(0.7) not BUYSTOP(0.7). Please help if know my mistake.
angevoyageur:
Don't you see I already answered ?
oh, yes I didn't see that. Now I did what you said but it ignores BUYSTOP(0.7). Means I have just SELLSTOP(1.2). what could be the mistake?
Don't you see I already answered ?
farrokhfa:
oh, yes I didn't see that. Now I did what you said but it ignores BUYSTOP(0.7). Means I have just SELLSTOP(1.2). what could be the mistake?
Who knows ? What errors are reported ? What's the code of SetOrder function() ?
oh, yes I didn't see that. Now I did what you said but it ignores BUYSTOP(0.7). Means I have just SELLSTOP(1.2). what could be the mistake?
angevoyageur:
Who knows ? What errors are reported ? What's the code of SetOrder function() ?
Who knows ? What errors are reported ? What's the code of SetOrder function() ?
the SetOrder() function is:
int SetOrder(int type, double lot, double price, double sl, double tp, int magic) { int ticket = -1; ticket = OrderSend(Symbol(), type, lot, price, 0, sl, tp, DoubleToStr(magic, 0), magic); int err = GetLastError(); if (ticket == -1 && err > 0) Print("err=", err, ", type=", type, ", price=", price, ", lot=", lot, ", sl=", sl, ", tp=", tp, ErrorDescription(err)); return (ticket); }
and Error 130 is reported.
Documentation on MQL5: Standard Constants, Enumerations and Structures / Codes of Errors and Warnings / Compilation Errors
- www.mql5.com
Standard Constants, Enumerations and Structures / Codes of Errors and Warnings / Compilation Errors - Documentation on MQL5
I only realise now that you are talking about mql4. Please post your question about mql4 on mql4.com forum.
Error 130 means you have a problem with your stops, check your sl and tp.
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
I want the EA to place two opposite pending orders in order to what I put below but it makes the same order type in YELLOW or RED case. For example in the RED case the EA would place SELLSTOP(1.2) & SELLSTOP(0.7) not BUYSTOP(0.7). Please help if know my mistake.