- for (int i = 0; i < Total; i ++) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {
Always count down when closing and test your return values (orderModify).
for (int i = Total-1; i >= 0; i ++) if ( OrderSelect(i, SELECT_BY_POS, MODE_TRADES) && OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {
extern int Slippage = 3;extern int StopLoss = 30;The argument for slippage is in points (Bid, Slippage*Point, StopLossLevel) If you use a 5 digit broker then a point is not a pip. All pip values (slippage and stoploss must be adjusted)
if (UseTakeProfit) TakeProfitLevel = Bid - TakeProfit * Point; else TakeProfitLevel = 0.0;Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);//++++ These are adjusted for 5 digit brokers. double pips2points, // slippage 3 pips 3=points 30=points pips2dbl; // Stoploss 15 pips 0.0015 0.00150 int Digits.pips; // DoubleToStr(dbl/pips2dbl, Digits.pips) int init() { if (Digits == 5 || Digits == 3) { // Adjust for five (5) digit brokers. pips2dbl = Point*10; pips2points = 10; Digits.pips = 1; } else { pips2dbl = Point; pips2points = 1; Digits.pips = 0; } //... if (UseTakeProfit) TakeProfitLevel = Bid - TakeProfit * pips2dbl; else TakeProfitLevel = 0.0; Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage*pips2points, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);
if (!EachTickMode) BarCount = Bars;Once the chart reaches max bars in chart, Bars no longer changes.
static datetime Time0; bool newBar = Time[shift] > Time0; Time0 = Time[0]; if (!newBar) //...
my ea doesnt work.This doesn't say anything, no mind readers here. What doesn't work, what do the print statements in the log say.
hi,
many thanks for your reply. i am sorry for the inappropriate format. i am new to the forum.
regarding the print statements there are no bugs reported. i will try it again with your adjustments.
many thanks again!
regards
gts
many thanks for your reply. i am sorry for the inappropriate format. i am new to the forum.
regarding the print statements there are no bugs reported. i will try it again with your adjustments.
many thanks again!
regards
gts

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
my ea doesnt work.
the ea should buy and sell if he crosses or undercrosses the daily open. could anyone please advise?
regards
gts