Files:
systemx3maeflip.mq4
4 kb
marty087:
I dont know how to get the error messages up so i can see where the problem is..... :-(
- OrderSend won't work once i use variable to define StopLoss
Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage
Always test return codes to find out WHYint ticket = OrderSend(...); if (ticket < 0) Alert("OrderSend Failed: ", GetLastError());
if (Close1+CloseExtra* Point <= Val) : StopLossLevel = Val + StopLoss * Point; : Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, 0.0 , ...
EAs must adjust for 4/5 digit brokers (TP, SL, AND slippage) On ECN brokers you must open first and THEN set stops//++++ These are adjusted for 5 digit brokers. int pips2points; // slippage 3 pips 3=points 30=points double pips2dbl; // Stoploss 15 pips 0.015 0.0150 int Digits.pips; // DoubleToStr(dbl/pips2dbl, Digits.pips) int init(){ if (Digits % 2 == 1){ // DE30=1/JPY=3/EURUSD=5 forum.mql4.com/43064#515262 pips2dbl = Point*10; pips2points = 10; Digits.pips = 1; } else { pips2dbl = Point; pips2points = 1; Digits.pips = 0; } // OrderSend(... Slippage.Pips * pips2points, Bid - StopLossPips * pips2dbl //---- These are adjusted for 5 digit brokers. /* On ECN brokers you must open first and THEN set stops int ticket = OrderSend(..., 0,0,...) if (ticket < 0) Alert("OrderSend failed: ", GetLastError()); else if (!OrderSelect(ticket, SELECT_BY_TICKET)) Alert("OrderSelect failed: ", GetLastError()); else if (!OrderModify(OrderTicket()...) Alert("OrderModify failed: ", GetLastError()); */
I think your logic is wrong, take this line out and try it to see if it executes a trade.
if (Close1+CloseExtra* Point <= Val) //Initial Sell Procedurereason being, your drawing a trendline that ends on the current Ask price and your comparing that to be more than close + close extra which will give you a value 50 points above the current Bid price so unless you have a spread of 50+ pips you wont get a trade, I havent tested all that but thats my guess to the cause of no trades
SDC:
If that happened there would be a message in the log/Experts tab . . .
I think your logic is wrong, take this line out and try it to see if it executes a trade.
why would there be a message if the logic is wrong ? if the code itself is correct it wouldnt generate any errors
The prb could be this:
if (BarCount != BarsBars return max values in your charts. I use Time[0], instead.
WHRoeder:
Thank you for your help WHRoeder: You hit the nail on the head with adding the order modify feature after the ticket was opened. Much appreciated.
- OrderSend won't work once i use variable to define StopLoss
Always test return codes to find out WHY -
EAs must adjust for 4/5 digit brokers (TP, SL, AND slippage) On ECN brokers you must open first and THEN set stops
Thanks everyone else for your suggestions, much appreciated.
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