Hello,
I have downloaded the following EA and modified it as i intend to trade, but there is a problem ...
With this settings, it doesnt open a Buy position, But if i change to false and Sell to true, it does work... with the same time and date ... ( with the Strategy Testing )
Here is my Code:
What could be the problem here ? i cant get it ... its so wierd ..
Thanks
EDIT: and one more thing, why in the script there is // Time frame: M5 and higher, what is the difference if i apply it to 1m chart and not 5m with Live account ?
Why do you use seconds in strategietester ?
total=OrdersTotal(); if(total<1)
Haven't you read other topics that this is a wrong method in live trading?
if(StartDay==Day() && StartHour==Hour() && StartMinute==Minute()/* && StartSeconds<=Seconds()*/ && Close[1]>Open[1] && OpenBuy)
total=OrdersTotal();
means the EA in incompatible with every other, including itself on other chart and manual trading.int total=0; for(int iPos = OrdersTotal()-1; iPos >= 0 ; iPos--) if ( OrderSelect(iPos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == Magic.Number // my magic number && OrderSymbol() == chart.symbol // and my pair. ){ total++; } if(total<1) ...
- Compare your two ordersends.
ticket=OrderSend(Symbol(),OP_BUY, Lots,Ask+(DistancefromAsk*Point),Slippage,0,0,"",MagicNumber,0,CLR_NONE); ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid, Slippage,0,0,"",MagicNumber,0,CLR_NONE);
You can't open a buy EXCEPT at the Ask.
- Had you tested your return code you would have found out WHY. Adjust for 4/5 digit brokers, tp, sl AND SLIPPAGE.
//++++ 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(){ OptParameters(); 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(), OrderOpenPrice(), SL, TP, 0) Alert("OrderModify failed: ", GetLastError()); */
-
means the EA in incompatible with every other, including itself on other chart and manual trading.
- Compare your two ordersends.
You can't open a buy EXCEPT at the Ask.
- Had you tested your return code you would have found out WHY. Adjust for 4/5 digit brokers, tp, sl AND SLIPPAGE.
Thank you sir, Thanks alot, i fixed the EA ..
But one more thing, why there is "// Time frame: M5 and higher" included in the EA since i can choice the date and time ( which i have added to the EA ) ...
How this thing work about the Chart times with EAs ..
And about this ... im getting differend Buys when changing the Period,
with 1M period i get 9 trades only,
with 5M i get 6,
and 15M i get 12 orders
from 2010.03.1 to 2010.03.31 ... its a 23 Trading days and 8 weekends(Closed) ..
i want to be sure that all the trades im going to make, will function 100% .. i dont want to miss any of my future trades ..
Thanks again, this is the last thing i want to know and hopefully i will be ready to start my Trading ..
some 1 please?
some 1 please?
You can use it on all the timeframes....
That's no problem when there is //..................
it is just a comment in the EA and not a working programline with an order
that you have different amount of trades testing in strategie the only thing i can think of is to look at the
history center and take a look at the different timeframes to the history
You can't place trades at seconds exactly with MT4 There is simply not every second new tick data
the best is to look for 30 seconds to open a new trade.....
The message of WHRoeder is very clear in what you have to do to make it possible trading at 5 digits brokers and 4 digit brokers in the right way
if you 're not sure freely testing on DEMO accounts ......
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I have downloaded the following EA and modified it as i intend to trade, but there is a problem ...
With this settings, it doesnt open a Buy position, But if i change to false and Sell to true, it does work... with the same time and date ... ( with the Strategy Testing )
Here is my Code:
What could be the problem here ? i cant get it ... its so wierd ..
Thanks
EDIT: and one more thing, why in the script there is // Time frame: M5 and higher, what is the difference if i apply it to 1m chart and not 5m with Live account ?