[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 420
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
declare a variable
bool ret;
before the loop
snowman647, huh?)
there's nothing wrong with the compilation, something's wrong with the algorithm.
snowman647, huh?)
There's nothing wrong with the compilation, something's wrong with the algorithm.
Probably need to watch how new positions are opened.
Наверно надо смотреть как открываются новые позиции
it does open, but it doesn't want to close)
There must be something wrong with the closing algorithm.
The code is the simplest, can't any of the experienced progamers understand what's wrong?)
it does open, but it doesn't want to close)
There must be something wrong with the closing algorithm.
The code is simple, can't any of the experienced progamers understand what's wrong?)
If opening does not use Magik, then how can you close by Magik. That's why the question arises.
Vinin, my good man) the magician is worth it))
extern double Lots=0.1;
int start()
{
bool ret;
double Ind11=iMA(NULL,0,12,0,0,0,0);
double Ind12=iMA(NULL,0,12,0,0,0,1);
if(Ind11>Ind12)
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"",16384,0,Green);
}
if(Ind11<Ind12)
{
for(ic=OrdersTotal()-1;ic>=0;ic--)
{
if(OrderSelect(ic,SELECT_BY_POS,MODE_TRADES)==false) continue;
if (OrderSymbol()==Symbol() && OrderMagicNumber()==16384)
{
if (OrderType()==OP_BUY)
OrderClose(OrderTicket(),OrderLots(),Bid,5,CLR_NONE);
if (OrderType()==OP_SELL)
OrderClose(OrderTicket(),OrderLots(),Ask,5,CLR_NONE);
}}
}
return(0);
}
Народ, кто может подсказать. Вчера делал советника по уровням Мюррея. Там смысл такой, что от уровней 8/0 и 0/8 надо продавать/покупать, а TP на пивот. Я использовал ObjectGet() чтобы получить линии, т.к. другого способа не нашел. Проблема в том, что если снижается волатильность, то уровни перерисовываются, и что самое главное автоматически меняется и TP. А менятся по ТС не должен. А вот как сделать чтоб TP не менялся? Заранее благодарен за помощь.
fix the algorithm for calculating lines and pivot
Vinin, уважаемый) магик то стоит))
extern double Lots=0.1;
int start()
{
bool ret;
double Ind11=iMA(NULL,0,12,0,0,0,0);
double Ind12=iMA(NULL,0,12,0,0,0,1);
if(Ind11>Ind12)
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"",16384,0,Green);
}
if(Ind11<Ind12)
{
for(ic=OrdersTotal()-1;ic>=0;ic--)
{
if(OrderSelect(ic,SELECT_BY_POS,MODE_TRADES)==false) continue;
if (OrderSymbol()==Symbol() && OrderMagicNumber()==16384)
{
if (OrderType()==OP_BUY)
OrderClose(OrderTicket(),OrderLots(),Bid,5,CLR_NONE);
if (OrderType()==OP_SELL)
OrderClose(OrderTicket(),OrderLots(),Ask,5,CLR_NONE);
}}
}
return(0);
}
Give NormalizeDouble(Ask, Digits) instead of Ask, NormalizeDouble(Bid, Digits) instead of Bid, and it will work