 |
????????????? ???????? ?? ?????????? ??????
|
Предыдущая тема :: Следующая тема |
Автор |
Сообщение |
ReLock
Зарегистрирован: 26.03.2009 Сообщения: 4
|
Добавлено: Чт Мар 26, 2009 7:54 pm Заголовок сообщения: ????????? e-MovingInWL2 |
|
|
???? ?? ???? ???????? ?????????? ??? ???????? e-MovingInWL2.
??? ?????? ?????????. ? ?????? ?????.
Код: |
void MovingInWL(string sy="", int op=-1, int mn=-1) {
double po, pp;
double CurrentPips; // ??????? ??????? ? ???????
int Multiplier, i, k=OrdersTotal();
for (i=0; i<k; i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
po = MarketInfo(OrderSymbol(), MODE_POINT); // ?????? ?????? ?????? ?????????
if (OrderType() == OP_BUY) // ???? ??? ?????? "???????"
{
pp = MarketInfo(OrderSymbol(), MODE_BID); // ???? ???????????
CurrentPips = pp - OrderOpenPrice(); // ??????? ? ???????
if (CurrentPips > LevelProfit*po)
{
Multiplier = CurrentPips / (LevelProfit*po);
if (OrderStopLoss() < (OrderOpenPrice()+Multiplier*LevelWLoss*po))
{
ModifyOrder(-1, OrderOpenPrice()+Multiplier*LevelWLoss*po, -1);
}
}
}
if (OrderType() == OP_SELL) // ???? ??? ?????? "???????"
{
pp = MarketInfo(OrderSymbol(), MODE_ASK); // ???? ???????
CurrentPips = OrderOpenPrice() - pp; // ??????? ? ???????
if (CurrentPips > LevelProfit*po)
{
Multiplier = CurrentPips / (LevelProfit*po);
if (OrderStopLoss() > (OrderOpenPrice()-Multiplier*LevelWLoss*po))
{
ModifyOrder(-1, OrderOpenPrice()-Multiplier*LevelWLoss*po, -1);
}
}
}
}
}
} |
?.?. ?? ?????? LevelProfit ??????? ? ?????? ????-???? ?? LevelWLoss ???????. ??????, ????, ????????, ? ???? LevelProfit = 20, ? LevelWLoss = 5, ?? ??? ??????? ? 100 ??????? ? ?????? ??????????? 25 ???????. ??? ????? 1/4. ????.
?????. ???? ?? ?????????? ???: ???? ????-???? ?? ??????, ?? ??????????? ?? ??????????? ?????. ? ???? ??????, ?? ??????????? ???:
???? ??????? ????? ????-?????? ? ????? ??????????? (??? ???????) ??? ????? ?????? (??? ???????) ????????? ??????? LevelProfit, ?? ??????? ????-???? ?? ????-????+LevelWLoss. ???????, ??????????? ?????? ????? ????, ??? ? ??????????? ??????, ?? ?? ??? ?????, ??? ??? ??????????? ????????-?????. ??? ??????? ?? ??????? LevelProfit ? LevelWLoss.
????? ? ????-?????? ????? ?????? ????? ?? ???? ?????  |
|
Вернуться к началу |
|
 |
ReLock
Зарегистрирован: 26.03.2009 Сообщения: 4
|
Добавлено: Вт Апр 07, 2009 2:21 pm Заголовок сообщения: |
|
|
? ?????? ? ????????? ?? ????? ???? ?? ??????? ?? ???????:
Код: |
//+----------------------------------------------------------------------------+
//| e-MovingInWL4.mq4 |
//| |
//| ??? ????? ?. aka KimIV |
//| http://www.kimiv.ru |
//| |
//| 27.03.2009 ???????? ?????????? ???? ? ????????? ?? ???????????? ???????. |
//+----------------------------------------------------------------------------+
#property copyright "Kim Igor V. aka KimIV"
#property link "http://www.kimiv.ru"
//------- ??????? ????????? ????????? -----------------------------------------+
extern string _P_Expert = "---------- ????????? ?????????";
extern bool AllSymbols = True; // ??????? ?? ????????? ???? ????????
extern int Magic = -1; // ????????????? ???????
extern int LevelProfit = 35; // ??????? ??????? ? ???????
extern double PercentWLoss= 0.30; // ??????? ????????? ? ?????????
extern bool ShowComment = True; // ?????????? ???????????
//------- ????????? ?????????? ???????? ???????? ------------------------------+
extern string _P_Performance = "---------- ????????? ??????????";
extern bool UseSound = True; // ???????????? ???????? ??????
extern string SoundSuccess = "expert.wav"; // ???? ??????
extern string SoundError = "timeout.wav"; // ???? ??????
extern int NumberOfTry = 2; // ?????????? ???????? ???????
//------- ?????????? ?????????? ????????? -------------------------------------+
bool gbDisabled = False; // ???? ?????????? ?????????
bool gbNoInit = False; // ???? ????????? ?????????????
color clModifyBuy = Aqua; // ???? ?????? ??????????? ???????
color clModifySell = Tomato; // ???? ?????? ??????????? ???????
//------- ??????????? ??????? ??????? -----------------------------------------+
#include <stdlib.mqh>
//+----------------------------------------------------------------------------+
//| |
//| ???????????????? ??????? |
//| |
//+----------------------------------------------------------------------------+
//| expert initialization function |
//+----------------------------------------------------------------------------+
void init() {
gbNoInit=False;
if (!IsTradeAllowed()) {
Message("??? ?????????? ?????? ????????? ??????????\n"+
"????????? ????????? ?????????");
gbNoInit=True; return;
}
if (!IsLibrariesAllowed()) {
Message("??? ?????????? ?????? ????????? ??????????\n"+
"????????? ?????? ?? ??????? ?????????");
gbNoInit=True; return;
}
if (!IsTesting()) {
if (IsExpertEnabled()) Message("???????? ????? ??????? ????????? ?????");
else Message("?????? ?????? \"????????? ?????? ??????????\"");
}
start();
}
//+----------------------------------------------------------------------------+
//| expert deinitialization function |
//+----------------------------------------------------------------------------+
void deinit() {
if (!IsTesting()) Comment("");
}
//+----------------------------------------------------------------------------+
//| expert start function |
//+----------------------------------------------------------------------------+
void start() {
if (gbDisabled) {
Message("??????????? ??????! ???????? ??????????!"); return;
}
if (gbNoInit) {
Message("?? ??????? ???????????????? ????????!"); return;
}
if (ShowComment) {
Comment(IIFs(AllSymbols, "AllSymbols ", "")
,"Magic="+IIFs(Magic<0, "?????", DoubleToStr(Magic, 0))+" "
,"LevelProfit="+DoubleToStr(LevelProfit, 0)+"? "
,"PercentWLoss="+DoubleToStr(PercentWLoss,2)+"% "
,"Spread: "+DoubleToStr(MarketInfo(Symbol(),MODE_SPREAD),0)+" "
,"Buy swap: "+DoubleToStr(MarketInfo(Symbol(),MODE_SWAPLONG),2)+" "
,"Sell swap: "+DoubleToStr(MarketInfo(Symbol(),MODE_SWAPSHORT),2)+" "
);
} else Comment("");
if (NormalizeDouble(PercentWLoss,2) >= 1) {
Message("??????????? ??????! ??????? ????????? ?????? ??????, ??? 1! ???????? ??????????!"); return;
}
string sy=IIFs(AllSymbols, "", NULL);
MovingInWL(sy, -1, Magic);
}
//+----------------------------------------------------------------------------+
//| |
//| ???????????????? ??????? |
//| |
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 01.09.2005 |
//| ???????? : ?????????? ???????????? ???????? ???????? |
//+----------------------------------------------------------------------------+
//| ?????????: |
//| op - ????????????? ???????? ???????? |
//+----------------------------------------------------------------------------+
string GetNameOP(int op) {
switch (op) {
case OP_BUY : return("Buy");
case OP_SELL : return("Sell");
case OP_BUYLIMIT : return("BuyLimit");
case OP_SELLLIMIT: return("SellLimit");
case OP_BUYSTOP : return("BuyStop");
case OP_SELLSTOP : return("SellStop");
default : return("Unknown Operation");
}
}
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 18.07.2008 |
//| ???????? : ?????????? ???? ?? ???? ???????? ? ??????????? ?? ???????. |
//+----------------------------------------------------------------------------+
color IIFc(bool condition, color ifTrue, color ifFalse) {
if (condition) return(ifTrue); else return(ifFalse);
}
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 01.02.2008 |
//| ???????? : ?????????? ???? ?? ???? ???????? ? ??????????? ?? ???????. |
//+----------------------------------------------------------------------------+
string IIFs(bool condition, string ifTrue, string ifFalse) {
if (condition) return(ifTrue); else return(ifFalse);
}
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 01.09.2005 |
//| ???????? : ????? ????????? ? ??????? ? ? ?????? |
//+----------------------------------------------------------------------------+
//| ?????????: |
//| m - ????? ????????? |
//+----------------------------------------------------------------------------+
void Message(string m) {
Comment(m);
if (StringLen(m)>0) Print(m);
}
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 28.11.2006 |
//| ???????? : ??????????? ?????? ?????????????? ?????????? ??????. |
//+----------------------------------------------------------------------------+
//| ?????????: |
//| pp - ???? ????????? ?????? |
//| sl - ??????? ??????? ????? |
//| tp - ??????? ??????? ????? |
//| ex - ???? ????????? |
//+----------------------------------------------------------------------------+
void ModifyOrder(double pp=-1, double sl=0, double tp=0, datetime ex=0) {
bool fm;
color cl=IIFc(OrderType()==OP_BUY
|| OrderType()==OP_BUYLIMIT
|| OrderType()==OP_BUYSTOP, clModifyBuy, clModifySell);
double op, pa, pb, os, ot;
int dg=MarketInfo(OrderSymbol(), MODE_DIGITS), er, it;
if (pp<=0) pp=OrderOpenPrice();
if (sl<0 ) sl=OrderStopLoss();
if (tp<0 ) tp=OrderTakeProfit();
pp=NormalizeDouble(pp, dg);
sl=NormalizeDouble(sl, dg);
tp=NormalizeDouble(tp, dg);
op=NormalizeDouble(OrderOpenPrice() , dg);
os=NormalizeDouble(OrderStopLoss() , dg);
ot=NormalizeDouble(OrderTakeProfit(), dg);
if (pp!=op || sl!=os || tp!=ot) {
for (it=1; it<=NumberOfTry; it++) {
if (!IsTesting() && (!IsExpertEnabled() || IsStopped())) break;
while (!IsTradeAllowed()) Sleep(5000);
RefreshRates();
fm=OrderModify(OrderTicket(), pp, sl, tp, ex, cl);
if (fm) {
if (UseSound) PlaySound(SoundSuccess); break;
} else {
er=GetLastError();
if (UseSound) PlaySound(SoundError);
pa=MarketInfo(OrderSymbol(), MODE_ASK);
pb=MarketInfo(OrderSymbol(), MODE_BID);
Print("Error(",er,") modifying order: ",ErrorDescription(er),", try ",it);
Print("Ask=",pa," Bid=",pb," sy=",OrderSymbol(),
" op="+GetNameOP(OrderType())," pp=",pp," sl=",sl," tp=",tp);
Sleep(1000*10);
}
}
}
}
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 11.09.2008 |
//| ???????? : ??????? ?????? ????? ? ????????? |
//+----------------------------------------------------------------------------+
//| ?????????: |
//| sy - ???????????? ??????????? ( "" - ????? ??????, |
//| NULL - ??????? ??????) |
//| op - ???????? ( -1 - ????? ???????) |
//| mn - MagicNumber ( -1 - ????? ?????) |
//+----------------------------------------------------------------------------+
void MovingInWL(string sy="", int op=-1, int mn=-1) {
double po, pp;
double nl; // ????? ??????? ????-?????
double cl; // ??????? ??????? ????-?????
int dg; // ?????????? ???????? ???? ????? ?????
int i, k = OrdersTotal();
for (i=0; i<k; i++)
{
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
dg = MarketInfo(OrderSymbol(), MODE_DIGITS); // ?????????? ???????? ???? ????? ?????
po = MarketInfo(OrderSymbol(), MODE_POINT); // ?????? ?????? ?????? ?????????
if (OrderType() == OP_BUY) // ???? ??? ?????? "???????"
{
pp = MarketInfo(OrderSymbol(), MODE_BID); // ???? ??????????? ???????
cl = OrderOpenPrice();
if (OrderStopLoss() != 0)
{
if (OrderStopLoss() > OrderOpenPrice()) cl = OrderStopLoss();
}
if (pp > (cl + LevelProfit*po))
{
nl = NormalizeDouble(cl+(LevelProfit*PercentWLoss*po),dg); // ????? ??????? ????-?????
if (cl < nl)
{
ModifyOrder(-1,nl,-1);
}
}
}
if (OrderType() == OP_SELL) // ???? ??? ?????? "???????"
{
pp = MarketInfo(OrderSymbol(), MODE_ASK); // ???? ?????? ???????
cl = OrderOpenPrice();
if (OrderStopLoss() != 0)
{
if (OrderStopLoss() < OrderOpenPrice()) cl = OrderStopLoss();
}
if (pp < (cl - LevelProfit*po))
{
nl = NormalizeDouble(cl-(LevelProfit*PercentWLoss*po),dg); // ????? ??????? ????-?????
if (cl > nl)
{
ModifyOrder(-1, nl, -1);
}
}
}
}
}
}
//+----------------------------------------------------------------------------+ |
?? ??????? ???? ?????!  |
|
Вернуться к началу |
|
 |
Subtle
Зарегистрирован: 30.06.2009 Сообщения: 1
|
Добавлено: Вт Июн 30, 2009 5:30 pm Заголовок сообщения: |
|
|
???????????? ?? ???? ..
(? ???? ???-?????? ?????????? ??) |
|
Вернуться к началу |
|
 |
artemex
Зарегистрирован: 25.06.2010 Сообщения: 1
|
Добавлено: Сб Июн 26, 2010 1:01 am Заголовок сообщения: |
|
|
???? ??????,?????????? ????????.? ????? ?? ? ???? ???????? ????????????? ???? ????,???? ??? ???????? ??????,??????????? ??????? ????,? ??? ????????? ???????? ?? n-???????,????????????? ? ?????????,? ????????????? ????????.?????????? ?????????? ? ????????? ????.??? ?????? ???????? ?? ???? |
|
Вернуться к началу |
|
 |
ReLock
Зарегистрирован: 26.03.2009 Сообщения: 4
|
Добавлено: Пт Фев 04, 2011 9:35 pm Заголовок сообщения: |
|
|
artemex писал(а): | ???? ??????,?????????? ????????.? ????? ?? ? ???? ???????? ????????????? ???? ????,???? ??? ???????? ??????,??????????? ??????? ????,? ??? ????????? ???????? ?? n-???????,????????????? ? ?????????,? ????????????? ????????.?????????? ?????????? ? ????????? ????.??? ?????? ???????? ?? ???? |
? ??? ?????? ??? ???????? ?????? ????? ????????? ????-????? ??? ?????? ???? ?? ???????? ??????? ?? ??????? ??????????? ?????? ? ???????, ???????? ??? ?????????? ????-???? ? ?????????. |
|
Вернуться к началу |
|
 |
ReLock
Зарегистрирован: 26.03.2009 Сообщения: 4
|
Добавлено: Пт Фев 04, 2011 10:16 pm Заголовок сообщения: |
|
|
Код: | //+----------------------------------------------------------------------------+
//| e-MovingInWL4.mq4 |
//| |
//| ??? ????? ?. aka KimIV |
//| http://www.kimiv.ru |
//| |
//| 27.03.2009 ???????? ?????????? ???? ? ????????? ?? ???????????? ???????. |
//+----------------------------------------------------------------------------+
#property copyright "Kim Igor V. aka KimIV"
#property link "http://www.kimiv.ru"
//------- ??????? ????????? ????????? -----------------------------------------+
extern string _P_Expert = "---------- ????????? ?????????";
extern bool AllSymbols = True; // ??????? ?? ????????? ???? ????????
extern int Magic = -1; // ????????????? ???????
extern int LevelProfit = 35; // ??????? ??????? ? ???????
extern double PercentWLoss= 0.30; // ??????? ????????? ? ?????????
extern int DefaultStopLoss = 50; // ??????? ????-????? ?? ?????????
extern bool ShowComment = True; // ?????????? ???????????
//------- ????????? ?????????? ???????? ???????? ------------------------------+
extern string _P_Performance = "---------- ????????? ??????????";
extern bool UseSound = True; // ???????????? ???????? ??????
extern string SoundSuccess = "expert.wav"; // ???? ??????
extern string SoundError = "timeout.wav"; // ???? ??????
extern int NumberOfTry = 2; // ?????????? ???????? ???????
//------- ?????????? ?????????? ????????? -------------------------------------+
bool gbDisabled = False; // ???? ?????????? ?????????
bool gbNoInit = False; // ???? ????????? ?????????????
color clModifyBuy = Aqua; // ???? ?????? ??????????? ???????
color clModifySell = Tomato; // ???? ?????? ??????????? ???????
//------- ??????????? ??????? ??????? -----------------------------------------+
#include <stdlib.mqh>
//+----------------------------------------------------------------------------+
//| |
//| ???????????????? ??????? |
//| |
//+----------------------------------------------------------------------------+
//| expert initialization function |
//+----------------------------------------------------------------------------+
void init() {
gbNoInit=False;
if (!IsTradeAllowed()) {
Message("??? ?????????? ?????? ????????? ??????????\n"+
"????????? ????????? ?????????");
gbNoInit=True; return;
}
if (!IsLibrariesAllowed()) {
Message("??? ?????????? ?????? ????????? ??????????\n"+
"????????? ?????? ?? ??????? ?????????");
gbNoInit=True; return;
}
if (!IsTesting()) {
if (IsExpertEnabled()) Message("???????? ????? ??????? ????????? ?????");
else Message("?????? ?????? \"????????? ?????? ??????????\"");
}
start();
}
//+----------------------------------------------------------------------------+
//| expert deinitialization function |
//+----------------------------------------------------------------------------+
void deinit() {
if (!IsTesting()) Comment("");
}
//+----------------------------------------------------------------------------+
//| expert start function |
//+----------------------------------------------------------------------------+
void start() {
if (gbDisabled) {
Message("??????????? ??????! ???????? ??????????!"); return;
}
if (gbNoInit) {
Message("?? ??????? ???????????????? ????????!"); return;
}
if (ShowComment) {
Comment(IIFs(AllSymbols, "AllSymbols ", "")
,"Magic="+IIFs(Magic<0, "?????", DoubleToStr(Magic, 0))+" "
,"LevelProfit="+DoubleToStr(LevelProfit, 0)+"? "
,"PercentWLoss="+DoubleToStr(PercentWLoss,2)+"% "
,"Default StopLoss="+DoubleToStr(DefaultStopLoss,0)+"? "
,"Spread: "+DoubleToStr(MarketInfo(Symbol(),MODE_SPREAD),0)+" "
,"Buy swap: "+DoubleToStr(MarketInfo(Symbol(),MODE_SWAPLONG),2)+" "
,"Sell swap: "+DoubleToStr(MarketInfo(Symbol(),MODE_SWAPSHORT),2)+" "
);
} else Comment("");
if (NormalizeDouble(PercentWLoss,2) >= 1) {
Message("??????????? ??????! ??????? ????????? ?????? ??????, ??? 1! ???????? ??????????!"); return;
}
string sy=IIFs(AllSymbols, "", NULL);
MovingInWL(sy, -1, Magic);
}
//+----------------------------------------------------------------------------+
//| |
//| ???????????????? ??????? |
//| |
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 01.09.2005 |
//| ???????? : ?????????? ???????????? ???????? ???????? |
//+----------------------------------------------------------------------------+
//| ?????????: |
//| op - ????????????? ???????? ???????? |
//+----------------------------------------------------------------------------+
string GetNameOP(int op) {
switch (op) {
case OP_BUY : return("Buy");
case OP_SELL : return("Sell");
case OP_BUYLIMIT : return("BuyLimit");
case OP_SELLLIMIT: return("SellLimit");
case OP_BUYSTOP : return("BuyStop");
case OP_SELLSTOP : return("SellStop");
default : return("Unknown Operation");
}
}
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 18.07.2008 |
//| ???????? : ?????????? ???? ?? ???? ???????? ? ??????????? ?? ???????. |
//+----------------------------------------------------------------------------+
color IIFc(bool condition, color ifTrue, color ifFalse) {
if (condition) return(ifTrue); else return(ifFalse);
}
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 01.02.2008 |
//| ???????? : ?????????? ???? ?? ???? ???????? ? ??????????? ?? ???????. |
//+----------------------------------------------------------------------------+
string IIFs(bool condition, string ifTrue, string ifFalse) {
if (condition) return(ifTrue); else return(ifFalse);
}
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 01.09.2005 |
//| ???????? : ????? ????????? ? ??????? ? ? ?????? |
//+----------------------------------------------------------------------------+
//| ?????????: |
//| m - ????? ????????? |
//+----------------------------------------------------------------------------+
void Message(string m) {
Comment(m);
if (StringLen(m)>0) Print(m);
}
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 28.11.2006 |
//| ???????? : ??????????? ?????? ?????????????? ?????????? ??????. |
//+----------------------------------------------------------------------------+
//| ?????????: |
//| pp - ???? ????????? ?????? |
//| sl - ??????? ??????? ????? |
//| tp - ??????? ??????? ????? |
//| ex - ???? ????????? |
//+----------------------------------------------------------------------------+
void ModifyOrder(double pp=-1, double sl=0, double tp=0, datetime ex=0) {
bool fm;
color cl=IIFc(OrderType()==OP_BUY
|| OrderType()==OP_BUYLIMIT
|| OrderType()==OP_BUYSTOP, clModifyBuy, clModifySell);
double op, pa, pb, os, ot;
int dg=MarketInfo(OrderSymbol(), MODE_DIGITS), er, it;
if (pp<=0) pp=OrderOpenPrice();
if (sl<0 ) sl=OrderStopLoss();
if (tp<0 ) tp=OrderTakeProfit();
pp=NormalizeDouble(pp, dg);
sl=NormalizeDouble(sl, dg);
tp=NormalizeDouble(tp, dg);
op=NormalizeDouble(OrderOpenPrice() , dg);
os=NormalizeDouble(OrderStopLoss() , dg);
ot=NormalizeDouble(OrderTakeProfit(), dg);
if (pp!=op || sl!=os || tp!=ot) {
for (it=1; it<=NumberOfTry; it++) {
if (!IsTesting() && (!IsExpertEnabled() || IsStopped())) break;
while (!IsTradeAllowed()) Sleep(5000);
RefreshRates();
fm=OrderModify(OrderTicket(), pp, sl, tp, ex, cl);
if (fm) {
if (UseSound) PlaySound(SoundSuccess); break;
} else {
er=GetLastError();
if (UseSound) PlaySound(SoundError);
pa=MarketInfo(OrderSymbol(), MODE_ASK);
pb=MarketInfo(OrderSymbol(), MODE_BID);
Print("Error(",er,") modifying order: ",ErrorDescription(er),", try ",it);
Print("Ask=",pa," Bid=",pb," sy=",OrderSymbol(),
" op="+GetNameOP(OrderType())," pp=",pp," sl=",sl," tp=",tp);
Sleep(1000*10);
}
}
}
}
//+----------------------------------------------------------------------------+
//| ????? : ??? ????? ?. aka KimIV, http://www.kimiv.ru |
//+----------------------------------------------------------------------------+
//| ?????? : 11.09.2008 |
//| ???????? : ??????? ?????? ????? ? ????????? |
//+----------------------------------------------------------------------------+
//| ?????????: |
//| sy - ???????????? ??????????? ( "" - ????? ??????, |
//| NULL - ??????? ??????) |
//| op - ???????? ( -1 - ????? ???????) |
//| mn - MagicNumber ( -1 - ????? ?????) |
//+----------------------------------------------------------------------------+
void MovingInWL(string sy="", int op=-1, int mn=-1) {
double po, pp;
double nl; // ????? ??????? ????-?????
double cl; // ??????? ??????? ????-?????
int dg; // ?????????? ???????? ???? ????? ?????
int i, k = OrdersTotal();
for (i=0; i<k; i++)
{
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
{
dg = MarketInfo(OrderSymbol(), MODE_DIGITS); // ?????????? ???????? ???? ????? ?????
po = MarketInfo(OrderSymbol(), MODE_POINT); // ?????? ?????? ?????? ?????????
if (OrderType() == OP_BUY) // ???? ??? ?????? "???????"
{
pp = MarketInfo(OrderSymbol(), MODE_BID); // ???? ??????????? ???????
cl = OrderOpenPrice();
if (OrderStopLoss() != 0)
{
if (OrderStopLoss() > OrderOpenPrice()) cl = OrderStopLoss();
} else
{
nl = NormalizeDouble(cl-DefaultStopLoss*po,dg);
ModifyOrder(-1,nl,-1);
}
if (pp > (cl + LevelProfit*po))
{
nl = NormalizeDouble(cl+(LevelProfit*PercentWLoss*po),dg); // ????? ??????? ????-?????
if (cl < nl)
{
ModifyOrder(-1,nl,-1);
}
}
}
if (OrderType() == OP_SELL) // ???? ??? ?????? "???????"
{
pp = MarketInfo(OrderSymbol(), MODE_ASK); // ???? ?????? ???????
cl = OrderOpenPrice();
if (OrderStopLoss() != 0)
{
if (OrderStopLoss() < OrderOpenPrice()) cl = OrderStopLoss();
} else
{
nl = NormalizeDouble(cl+DefaultStopLoss*po,dg);
ModifyOrder(-1,nl,-1);
}
if (pp < (cl - LevelProfit*po))
{
nl = NormalizeDouble(cl-(LevelProfit*PercentWLoss*po),dg); // ????? ??????? ????-?????
if (cl > nl)
{
ModifyOrder(-1, nl, -1);
}
}
}
}
}
}
//+----------------------------------------------------------------------------+ |
? ????????? ??? ????????? ?? ????. ??? ???????? ??? ???????? (?? FiboGroup) ????????: Expert 'e-MovingInWL2' is not custom indicator and will be removed |
|
Вернуться к началу |
|
 |
Descendant
Зарегистрирован: 21.04.2020 Сообщения: 1
|
Добавлено: Ср Апр 22, 2020 12:27 am Заголовок сообщения: |
|
|
ReLock писал(а): |
? ????????? ??? ????????? ?? ????. ??? ???????? ??? ???????? (?? FiboGroup) ????????: Expert 'e-MovingInWL2' is not custom indicator and will be removed |
???????? ? ?????? ? ?? ???????????. ????????. ??! ???? «??»! ?? ?? ??? ?????, ?? ?? ????? ? ???????????.
ReLock , ????? ??????? ????. ?? ??? ???? ??????????? ?????? ?????????????? ?? ???? ?????? ? ??????? AllSymbols = False ????????? ? ?????? ????????? ?? ?????? ???????????? ?? ???? ???????? ????????. ??? ?????, ??? ??? ?????, ?? ????. ?????? ??????????? ?????? ?????? ? ??????? ???? ?????. ???????? ?? ????? ??? ??????????? ????????. ??? ?????? ??? ??? ?????????. ???? ??? ???. ???? ? ????????, ???????. ?? ????? ??? ???????????. |
|
Вернуться к началу |
|
 |
Descendant
Зарегистрирован: 21.04.2020 Сообщения: 1
|
Добавлено: Чт Апр 22, 2021 10:54 pm Заголовок сообщения: |
|
|
Я один не вижу текста? Вместо текста - вместо русского текста одни знаки вопросов — «?????»
Ya odin ne vizhu teksta? Vmesto teksta - vmesto russkogo teksta odni znaki voprosov — «?????» |
|
Вернуться к началу |
|
 |
Descendant
Зарегистрирован: 21.04.2020 Сообщения: 1
|
Добавлено: Чт Апр 22, 2021 10:56 pm Заголовок сообщения: |
|
|
Я один не вижу текста? Вместо текста - вместо русского текста одни знаки вопросов - ?????
Ya odin ne vizhu teksta? Vmesto teksta - vmesto russkogo teksta odni znaki voprosov - ????? |
|
Вернуться к началу |
|
 |
Descendant
Зарегистрирован: 21.04.2020 Сообщения: 1
|
Добавлено: Чт Апр 22, 2021 10:57 pm Заголовок сообщения: |
|
|
Я один не вижу текста? Вместо текста - вместо русского текста одни знаки вопросов - ?????
Ya odin ne vizhu teksta? Vmesto teksta - vmesto russkogo teksta odni znaki voprosov - ????? |
|
Вернуться к началу |
|
 |
|
|
Вы не можете начинать темы Вы не можете отвечать на сообщения Вы не можете редактировать свои сообщения Вы не можете удалять свои сообщения Вы не можете голосовать в опросах Вы не можете добавлять вложения в этом форуме Вы не можете просматривать вложения в этом форуме
|
Powered by phpBB © 2001, 2005 phpBB Group
|