The Market has more than 400 indicators. Try any of them!
Moderator
178205
2009.11.30 13:58
Many people asks to post a simple expert advisor. Here is it.

1762
2009.11.30 15:50

I think

```void CLOSEORDER(string ord)
{
for (int i=0; i<OrdersTotal(); i++)
{
{
if (OrderSymbol()!=Symbol()) continue;
if (OrderType()==OP_SELL && ord=="Sell")
}
}
}
```

should be

```void CLOSEORDER(string ord)
{
for (int i=OrdersTotal()-1; i>=0; i--)
{
{
if (OrderSymbol()!=Symbol()) continue;
if (OrderType()==OP_SELL && ord=="Sell")
}
}
}
```

FWIW

-BB-

94235
2009.11.30 16:29
BarrowBoy:

Editor's remark:

You are right. Code corrected.

Thank you.

13959
2009.12.01 19:15

I think

```if (LOT>MarketInfo(Symbol(),MODE_MAXLOT)) LOT = MarketInfo(Symbol(),MODE_MAXLOT);
if (LOT<MINLOT)                           LOT = MINLOT;
if (MINLOT<0.1) LOT = NormalizeDouble(LOT,2); else LOT = NormalizeDouble(LOT,1);```

Should be

```double	LotStep = MarketInfo( Symbol(), MODE_LOTSTEP );
LOT=MathFloor(	LOT / LotStep )*LotStep;
if (LOT>MarketInfo(Symbol(),MODE_MAXLOT)) LOT = MarketInfo(Symbol(),MODE_MAXLOT);
if (LOT<MINLOT)                           LOT = MINLOT;

```
13959
2009.12.01 21:46

Or simplier

```void CLOSEORDER(string ord)
{
for (int i=OrdersTotal()-1; i>=0; i--)  if (
&& OrderMagicNumber() == MagicNumber		// with my magic number,
&& OrderSymbol()	 == Symbol() ) {	// in my chart.
if (OrderType()==OP_SELL && ord=="Sell")
}
}
```
16319
2010.01.25 23:32

Could you tell more what 's Timeframe (M1)(M5)(M15) (M30) with EUR/USD are the best for this File.

Best Reguard ?

16319
2010.02.02 20:55

yeh but what time frames ?

10252
2010.02.03 06:22
16
2015.05.14 16:23
`Hello Vladimir , although imposed stop loss and take profit , when it takes a position I have to put them manually , how come ?`
10252
2015.05.14 17:32
damianino:

В параметрах советника есть возможность устанавливать стоплосс и тейкпрофит.

Я не понимаю, что у Вас не получилось.

/