mir0n0v писал(а) >>
Подскажите как в програме написать время истечения отложенного ордера??? Никак не могу разобраться... Заранее спасибо! mir0n0v@rambler.ru
int Order_Open(string _Symbol, int Magic, int OP,int VitasBar){ GetLastError(); RefreshRates(); double Spred= MarketInfo(_Symbol,MODE_SPREAD)/Point; double StopLevel=MarketInfo(_Symbol,MODE_STOPLEVEL); int _EX=0; if(VitasBar>0) _EX=TimeCurrent()+VitasBar*60; switch (OP) { case OP_BUYSTOP: if ((PriceOpen-Ask)/Point<StopLevel) PriceOpen=Ask+StopLevel*Point; if ((PriceOpen-PriceStop)/Point<StopLevel) PriceStop=PriceOpen-StopLevel*Point; if ((PriceTake-PriceOpen)/Point<StopLevel) PriceTake=PriceOpen+StopLevel*Point; break; case OP_SELLSTOP: if ((Bid-PriceOpen)/Point<StopLevel) PriceOpen=Bid-StopLevel*Point; if ((PriceStop-PriceOpen)/Point<StopLevel) PriceStop=PriceOpen+StopLevel*Point; if ((PriceOpen-PriceTake)/Point<StopLevel) PriceTake=PriceOpen-StopLevel*Point; break; case OP_BUYLIMIT: if ((PriceOpen-Ask)/Point<StopLevel) PriceOpen=Ask-StopLevel*Point; if ((PriceOpen-PriceStop)/Point<StopLevel) PriceStop=PriceOpen-StopLevel*Point; if ((PriceTake-PriceOpen)/Point<StopLevel) PriceTake=PriceOpen+StopLevel*Point; break; case OP_SELLLIMIT: if ((Bid-PriceOpen)/Point<StopLevel) PriceOpen=Bid+StopLevel*Point; if ((PriceStop-PriceOpen)/Point<StopLevel) PriceStop=PriceOpen+StopLevel*Point; if ((PriceOpen-PriceTake)/Point<StopLevel) PriceTake=PriceOpen-StopLevel*Point; break; } int res; // PriceStop=0; // PriceTake=0; res=OrderSend(_Symbol, OP, Lots, PriceOpen, Spred, PriceStop, PriceTake, _comment, Magic, _EX); int err=GetLastError(); if (err>0) { Print("Error=",err," OP=",sOP[OP], " Ask=", DoubleToStr(Ask,Digits), " Bid=", DoubleToStr(Bid,Digits), " Price=",DoubleToStr(PriceOpen,Digits), " Stop=",DoubleToStr(PriceStop,Digits), " Take=",DoubleToStr(PriceTake,Digits) ); return(-1); } return(res); }
Вы упускаете торговые возможности:
- Бесплатные приложения для трейдинга
- 8 000+ сигналов для копирования
- Экономические новости для анализа финансовых рынков
Регистрация
Вход
Вы принимаете политику сайта и условия использования
Если у вас нет учетной записи, зарегистрируйтесь
Подскажите как в програме написать время истечения отложенного ордера??? Никак не могу разобраться... Заранее спасибо! mir0n0v@rambler.ru