if(Volume[0]>1) return;
Volume is unreliable, you can miss ticks. Bars is unreliable (max bars on chart) Always use time.static datetime time0; if (time0 == Time[0]) return; time0 = Time[0];
if(sto>80)Condition1=True;
And when do you set it to false?Condition1= sto>80;
- You MUST count down when closing orders.
- Always test return codes
if (!OrderClose(...)) Alert("OrderClose failed: ", GetLastError());
res=OrderSend(Symbol(),OP_BUY,LotsOptimized(),Ask,3,0,0,"",MAGICMA,0,Blue); : OrderClose(OrderTicket(),OrderLots(),Bid,3,White);
EA's must 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(){ 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(...) 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()); */ : res=OrderSend(Symbol(),OP_BUY,LotsOptimized(),Ask,3*pips3point,0,0,"",MAGICMA,0,Blue); : OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3*pips3point,White);
WHRoeder:
- Volume is unreliable, you can miss ticks. Bars is unreliable (max bars on chart) Always use time.
- And when do you set it to false?
- You MUST count down when closing orders.
- Always test return codes
- EA's must adjust for 4/5 digit brokers, TP, SL, AND slippage
Yes, I use MBTrading right now. The problem that I am having is, you can't have a StopLoss or TakeProfit in the same line as the Order. At least if it's
a Market Order. A limit or Stop Order will work.
Thanks,
JimTrader

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
Where I am a little unsure here is under the Sell and Buy code. In other words the If(Condition1 && Condition2) goes to another If statement for my final requirement?? Seems like we would need and else in here.
JimTrader1