[ARCHIVE !] Toute question de débutant, pour ne pas encombrer le forum. Professionnels, ne passez pas à côté. Nulle part sans toi - 4. - page 139

 
first_may:
Après-midi. MT4 a un indicateur de volumes, montre-t-il le volume en tick ou non ?

Volume de tic-tac
 
CLAIN:

Ce qui est intéressant, c'est que le dépôt est suffisant - j'ai une grande réserve là-bas.
Immédiatement après avoir ouvert une position, affichez une erreur dans Print() et voyez la raison.
 

Question.

J'ai écrit un indicateur. Les principales fonctions Order et Account utilisées sont Symbol() partout iClose iOpen. Mais pour une raison quelconque, l'indicateur ne fonctionne QUE sur EURUSD............. J'ai essayé d'autres outils qui ne fonctionnent pas ((.

L'essence de l'indicateur : affiche des informations sur le compte, les fonds libres, le nombre de lots à ouvrir, le montant ouvert, le rapport Profit/Risque dans l'argent, mis en place UNIQUEMENT si (OrderSymbol()!=Symbol()) continue ;

J'ai réexaminé la raison 10 à 20 fois. Je ne comprends pas... ((((

Merci d'avance

 
sergeev:

tique

Il s'avère que tous les indicateurs de MT4 du groupe volume affichent un volume en tick?
 
paladin80:
Immédiatement après l'ouverture d'une position, print() sort une erreur et en voit la raison.


Ce qui est intéressant, c'est qu'il n'y a aucun problème sur le testeur. Depuis 2000 jusqu'à aujourd'hui, il a fonctionné sans aucune vidange.

Le code aiderait-il ?

//+------------------------------------------------------------------+ 
//| StMartin.mq4 | 
//| Sergey Kodolov | 
//| 84232676421@mail.ru | 
//+------------------------------------------------------------------+ 
#property copyright "Sergey Kodolov" 
#property link "84232676421@mail.ru" 

    extern int TP = 1000; 
    extern int TS = 1000; 
    extern double lots = 1.0; 

    double volumz; 
    int ticket,total; 
    int slip = 3; 
    int Magic = 7; 

 


//+------------------------------------------------------------------+ 
//| expert initialization function | 
//+------------------------------------------------------------------+ 
int init() 
  { 
//---- 

        ticket = OrderSend(Symbol(),OP_BUY,lots,Ask,slip,Bid-TS*Point,Bid+TP*Point,"First order",Magic,0,Yellow); //открываем первый ордер 
 
//---- 
   return(0); 
  } 
//+------------------------------------------------------------------+ 
//| expert deinitialization function | 
//+------------------------------------------------------------------+ 
int deinit() 
  { 
//---- 

//---- 
   return(0); 
  } 
//+------------------------------------------------------------------+ 
//| expert start function | 
//+------------------------------------------------------------------+ 
int start() 
  { 
//---- 

OrderOpenFunction(); 
StrahBuy();
StrahSell();

//---- 
   return(0); 
  } 
//+------------------------------------------------------------------+ 

void OrderOpenFunction()
{
   OrderSelect(ticket,SELECT_BY_TICKET);
   if(OrderCloseTime()>0)
   {
      
      total = OrdersTotal();
      Comment("OrderCloseTime = ",OrderCloseTime()," ms");
      if(total < 1) 
      { 
         OrderSelect(ticket,SELECT_BY_TICKET); 
         volumz = OrderLots(); 
         Print("Orderlots = ", OrderLots());
         if(OrderType() == OP_BUY)
         {
            if(OrderClosePrice()-OrderOpenPrice()>0)
            {
               ticket = OrderSend(Symbol(),OP_BUY,lots,Ask,slip,Bid-TS*Point,Bid+TP*Point,0,Magic,0,Green);
            }
            if(OrderClosePrice()-OrderOpenPrice()<0)
            {
               double lot1 = volumz*2; 
               ticket = OrderSend(Symbol(),OP_SELL,lot1,Bid,slip,Ask+TS*Point,Ask-TP*Point,0,Magic,0,Red); 
            }
         }
         if(OrderType() == OP_SELL)
         {
            if(OrderClosePrice()-OrderOpenPrice()<0)
            {
               ticket = OrderSend(Symbol(),OP_SELL,lots,Bid,slip,Ask+TS*Point,Ask-TP*Point,0,Magic,0,Red);
            }
            if(OrderClosePrice()-OrderOpenPrice()>0)
            {
               double lot2 = volumz*2; 
               ticket = OrderSend(Symbol(),OP_BUY,lot2,Ask,slip,Bid-TS*Point,Bid+TP*Point,0,Magic,0,Green);
            }
         }
      }
   }    
}      
  
void StrahBuy()
{
   total = OrdersTotal();
   if(total<1)
   {
      OrderSelect(0,SELECT_BY_POS);
      if(OrderType() == OP_BUY)
      {
         if(OrderClosePrice()-OrderOpenPrice()>0)
         {
            ticket = OrderSend(Symbol(),OP_BUY,lots,Ask,slip,Bid-TS*Point,Bid+TP*Point,0,Magic,0,Green);
         }
         if(OrderClosePrice()-OrderOpenPrice()<0)
         {
            double lot1 = volumz*2; 
            ticket = OrderSend(Symbol(),OP_SELL,lot1,Bid,slip,Ask+TS*Point,Ask-TP*Point,0,Magic,0,Red); 
         }
      }      
   }
}

void StrahSell()
{
   total = OrdersTotal();
   if(total<1)
   {
      OrderSelect(0,SELECT_BY_POS);
      if(OrderType() == OP_SELL)
      {
         if(OrderClosePrice()-OrderOpenPrice()<0)
         {
            ticket = OrderSend(Symbol(),OP_SELL,lots,Bid,slip,Ask+TS*Point,Ask-TP*Point,0,Magic,0,Red);
         }
         if(OrderClosePrice()-OrderOpenPrice()>0)
         {
            double lot2 = volumz*2; 
            ticket = OrderSend(Symbol(),OP_BUY,lot2,Ask,slip,Bid-TS*Point,Bid+TP*Point,0,Magic,0,Green);
         }
      }
   }   
}

Je veux dire, j'ai une fonction principale ici et les deux autres ne font que la dupliquer. Je l'ai fait en tant qu'assurance, mais ça ne fonctionne toujours pas.

 
CLAIN:


la chose intéressante est qu'il n'y a aucun problème sur le testeur. Il fonctionne depuis 2000 à ce jour sans vidange.

Le code pourrait peut-être vous aider ?

c'est-à-dire que j'ai une fonction principale ici et les deux autres ne font que la dupliquer. Je l'ai fait pour l'assurance, mais il ne fonctionne toujours pas.

Un code très étrange. Je suis très confus par le fait que vous ouvrez une position dans l'initialisation et recherchez des ordres sans opérateur. Je n'ai jamais rien vu de tel auparavant. Insérez Print () dans votre code. Crois-moi, ça aide.
 
CLAIN:


Ce qui est intéressant, c'est que sur le testeur, il n'y a pas de problème. Il fonctionne depuis 2000 jusqu'à aujourd'hui sans se vider.

Le code aiderait-il ?

Je veux dire, j'ai une fonction principale ici et les deux autres ne font que la dupliquer. C'est une assurance, mais ça ne fonctionne toujours pas.

Testeur : stop loss #68 à 1.2887 (1.2885 / 1.2887)
16:56:31 2010.07.15 15:04 EURUSD,M30 : Lots d'ordres = 1
16:56:31 2010.07.15 15:04 Testeur : pas assez d'argent pour acheter 2.00 EURUSD à 1.2887 sl : 1.1885 tp : 1.2905 [2010.07.15 15:04]
16:56:31 2010.07.15 15:04 Testeur : PrevBalance : 1838.36, PrevPL : 0.00, PrevEquity 1838.36, PrevMargin : 0.00, NewMargin : 2577, FreeMargin : -738.84
16:56:31 2010.07.15 15:04 martin EURUSD,M30 : Erreur OrderSend 134

je pense que TP=1000 et SL=1000 est beaucoup trop même si lots=1.0))

Essayez de mettre un lot plus petit et TP=1000 et je pense que vous serez heureux.

 

PEOPLE !!!!!!!!! Au secours ! !! S'il vous plaît, réitérez ! !! QUESTION ALORS : POURQUOI l'indicateur s'ouvre dans MT4 UNIQUEMENT sur EURUSD !!!!!!!!!!!!!!! Quel mystère. Il n'y a pas de restriction de paire dans l'indicateur, Symbol() est partout, les fonctions principales sur le compte Ordre et Compte. Lorsque je retire l'indicateur, il ne fonctionne pas non plus sur une autre paire, ou plutôt MT4 se bloque complètement jusqu'à ce que je le coupe. J'ai écrit l'indicateur tout seul. Je n'arrive pas à comprendre ce comportement avec les autres paires. Comme il s'agit d'un indicateur long, je ne veux pas l'afficher. Mais je vous assure qu'il n'y a rien d'anormal à ce qu'il fonctionne sans problème UNIQUEMENT sur eurodollar ???????????????????????.

PRO RÉSOUDRE LE PUZZLE)))))))))))))))))))))))))))))))) Je n'ai pas de chance.................

Voici un extrait sur les fonctions utilisées

++++++++++++++++++++++++++++++++++++ Code de saut

//--- Suppression des objets de totaux
Del_comment("MN1 Trend") ;
Del_comment("W1 Trend") ;
Del_comment("D1 Trend") ;
Del_comment("H4 Trend") ;
Del_comment("H1 Trend") ;
Del_comment("ord .no : ") ;
Del_comment("ord .# : ") ;
//---
TRENDS("MN1 Trend",PERIOD_MN1, 1,86, 33, Lab_Trend_Bull,Lab_Trend_Bear,Lab_Trend_Doj, 42) ;
TRENDS("W1 Trend", PERIOD_W1, 1,111, 48, Lab_Trend_Bull,Lab_Trend_Bear,Lab_Trend_Doj, 12) ;
TRENDS("D1 Trend", PERIOD_D1, 1,97, 48, Lab_Trend_Bull,Lab_Trend_Bear,Lab_Trend_Doj, 12) ;
TRENDS("H4 Trend", PERIOD_H4, 1,111, 62, Lab_Trend_Bull,Lab_Trend_Bear,Lab_Trend_Doj,12) ;
TRENDS("H1 Trend", PERIOD_H1, 1,97, 62, Lab_Trend_Bull,Lab_Trend_Bear,Lab_Trend_Doj, 12) ;

str=StringLen(AccountCompany()) ;
si(str<=31) shf=31-str ;
sinon
si(str>=31) shf=0 ;
Commen("NameCo",AccountCompany(), 1, shf, 40, "Times New Roman", color_Fon,7) ;
Commen("in",ABC v2, 1, 36, 51, "Times New Roman", color_Fon,11) ;
Commen("txt_symb",Symbol(), 1, 3, 64, "Times New Roman", color_Fon,16) ;

si(OffABC==vrai)
Commen("off+", "OFF", 1, 7, 51, "Times New Roman", color_Loss,10) ;

si(OffABC==false)
{
Commen("in+", "INC", 1, 7, 51, "Times New Roman", color_Profit,10) ;
int OneLot= MarketInfo(Symbol(),MODE_MARGINREQUIRED) ;
int TickValue= MarketInfo(Symbol(),MODE_TICKVALUE) ;

si(Chiffres==2) pips=100 ;
sinon
si(Chiffres==3) pips=1000 ;
sinon
si(Chiffres==4) pips=10000 ;
sinon
si(Chiffres==5) pips=100000 ;

if(!IsConnected())
{
ObjectDelete("in+") ;
Commen("off+", "OFF", 1, 7, 51, "Times New Roman", color_Loss,10) ;
Commen("noconnect", "no connected", 1, 7, 85, "Times New Roman", color_Loss,14) ;
}
sinon
if(IsConnected())
{
ObjectDelete("off+") ;
ObjectDelete("noconnect") ;
Commen("in+", "INC", 1, 7, 51, "Times New Roman", color_Profit,10) ;
}

if(AccountCurrency()=="RUB")
{
EQ_USD= AccountEquity()/iClose("USDRUB",PERIOD_M1,0) ;
FreeMargin_USD= (AccountFreeMargin()-AccountStopoutLevel())/iClose("USDRUB",PERIOD_M1,0) ;
PRF_USD= AccountProfit()/iClose("USDRUB",PERIOD_M1,0) ;
LOT_01= (AccountFreeMargin()-AccountStopoutLevel())/(OneLot/10) ;
LOT_1= (AccountFreeMargin()-AccountStopoutLevel())/OneLot ;
ObjectDelete("nodepo") ;
}
sinon
if(AccountCurrency()=="RUR")
{
EQ_USD= AccountEquity()/iClose("USDRUR",PERIOD_M1,0) ;
FreeMargin_USD= (AccountFreeMargin()-AccountStopoutLevel())/iClose("USDRUR",PERIOD_M1,0) ;
PRF_USD= AccountProfit()/iClose("USDRUR",PERIOD_M1,0) ;
LOT_01= (AccountFreeMargin()-AccountStopoutLevel())/(OneLot/10) ;
LOT_1= (AccountFreeMargin()-AccountStopoutLevel())/OneLot ;
ObjectDelete("nodepo") ;
}
sinon
si(AccountCurrency()=="EUR")
{
EQ_USD= AccountEquity()*iClose("EURUSD",PERIOD_M1,0) ;
FreeMargin_USD= (AccountFreeMargin()-AccountStopoutLevel())*iClose("EURUSD",PERIOD_M1,0) ;
PRF_USD= AccountProfit()*iClose("EURUSD",PERIOD_M1,0) ;
LOT_01= (AccountFreeMargin()-AccountStopoutLevel())*(OneLot/10) ;
LOT_1= (AccountFreeMargin()-AccountStopoutLevel())*OneLot ;
ObjectDelete("nodepo") ;
}
sinon
if(AccountCurrency()=="USD")
{
EQ_USD= AccountEquity() ;
FreeMargin_USD= AccountFreeMargin()-AccountStopoutLevel() ;
PRF_USD= AccountProfit() ;
LOT_01= FreeMargin_USD/(OneLot/10) ;
LOT_1= FreeMargin_USD/OneLot ;
ObjectDelete("nodepo") ;
}

if(IsConnected() && AccountCurrency()!="RUB" && AccountCurrency()!="RUR" && AccountCurrency()!="EUR" && AccountCurrency()!="USD")
{
ObjectDelete("in+") ;
ObjectDelete("noconnect") ;
Commen("off+", "OFF", 1, 7, 51, "Times New Roman", color_Loss,10) ;
Commen("depo_symbl",AccountCurrency(), 1, 112, 85, "Times New Roman", color_Equity_Account,14) ;
Commen("nodepo",impracticable",1, 7, 85, "Times New Roman",color_Free,14) ;
}
//---

si(Orders_OK==false) order=1 ;
sinon ordre=0 ;

si(OrdersTotal()>=ordre)
{
for(int pos=OrdersTotal() ; pos>=0 ; pos--)
{
if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()!=Symbol()) continue ;
{
SUMM= SUMM+OrderLots() ;
SWAP=SWAP+OrderSwap() ;
COMMIS=COMMIS+OrderCommission() ;
OpenPrice=OpenPrice+OrderOpenPrice() ;

//--- //COMMANDES SUR BAY
si(OrderType()==OP_BUY)
{
baylot= OrderLots() ;
si(baylot>=1 && baylot<99.0)
{
bSL1= bSL1+(OrderStopLoss()) ;
bTP1= bTP1+(OrderTakeProfit()) ;
bOPN1= bOPN1+(OrderOpenPrice() ;
si(bSL1>0) bsumL1=bsumL1+1 ;
si(bTP1>0) bsumP1=bsumP1+1 ;
si(bOPN1>0) bsumO1=bsumO1+1 ;
}
if(baylot>=0.1 && baylot<0.99)
{
bSL01= bSL01+(OrderStopLoss()) ;
bTP01= bTP01+(OrderTakeProfit()) ;
bOPN01= bOPN01+(OrderOpenPrice() ;
si(bSL01>0) bsumL01=bsumL01+1 ;
si(bTP01>0) bsumP01=bsumP01+1 ;
if(bOPN01>0) bsumO01=bsumO01+1;
}
} //OP_BUY

++++++++++++++++++++++++++++++++++++++++++++++++++ Пропуск кода

Fonction

void TRENDS(string name, int PER, int n, int X, int Y, color Lab_Trend_Bull, color Lab_Trend_Bear, color Lab_Trend_Doj, int rsm)
{
int A,B,a,b,cod ;
double Fup,Fdw ;
double OPEN= iOpen(Symbol(),PER,1) ;
double CLOSE= iClose(Symbol(),PER,1) ;
double EMA21= iMA(Symbol(),PER,21,0,MODE_EMA,PRICE_CLOSE,1) ;
double EMA89= iMA(Symbol(),PER,89,0,MODE_EMA,PRICE_CLOSE,1) ;
chaîne de caractères nom2 ;
couleur_tendance ;
bool FLEAT=false ;

alors que(A<1)
{
double FUPPER= iFractals(Symbol(),PER,MODE_UPPER,a) ;
if(FUPPER>0) { Fup=FUPPER ; A++ ; }
a++ ;
}
alors que(B<1)
{
double FLOWER= iFractals(Symbol(),PER,MODE_LOWER,b) ;
if(FLOWER>0) { Fdw=FLOWER ; B++ ; }
b++ ;
}
si((CLOSE>=OPEN && CLOSE<Fup) || (CLOSE<=OPEN && CLOSE>Fdw))
FLEAT=vrai ;

si(EMA21>EMA89 && FLEAT==vrai)
{ cod= 114 ; color_trend=Lab_Trend_Doj ; name2="EMA21>eme89" ; } // Taureau
sinon
if(EMA21<EMA89 && ((CLOSE>=OPEN && CLOSE>=Fup) || (CLOSE<=OPEN && CLOSE>=Fup))
{ cod=111 ; color_trend=Lab_Trend_Bull ; name2="Fractal UPPER" ; } // Taureau
sinon
if(EMA21>EMA89 && ((CLOSE>=OPEN && CLOSE>=Fup) || (CLOSE<=OPEN && CLOSE>=Fup)))
{ cod=110 ; color_trend=Lab_Trend_Bull ; name2="EMA21>ema89 + FRACTAL UPPER" ; } // Taureau
sinon
si(EMA21<EMA89 && FLEAT==vrai)
{ cod= 113 ; color_trend=Lab_Trend_Doj ; name2= "ema21<EMA89" ; } // ours
sinon
if(EMA21>EMA89 && ((CLOSE<=OPEN && CLOSE<=Fdw) || (CLOSE>=OPEN && CLOSE<=Fdw))
{ cod=111 ; color_trend=Lab_Trend_Bear ; name2="Fractal LOWER" ; } // ours
sinon
if(EMA21<EMA89 && ((CLOSE<=OPEN && CLOSE<=Fdw) || (CLOSE>=OPEN && CLOSE<=Fdw))
{ cod= 110 ; color_trend=Lab_Trend_Bear ; name2="ema21<EMA89 + FRACTAL LOWER" ; } // ours
sinon
si(EMA21==EMA89 || FLEAT==vrai)
{ cod= 110 ; color_trend=Lab_Trend_Doj ; name2= "ema21==ema89 || Fractal" ; } // doj

nom=nom+""+nom2 ;
si(PER==PERIOD_MN1) cod=111 ;
si(cod==110)
{ rsm=rsm+3 ; X=X-1 ; Y=Y-3 ; }

ObjectCreate(name,OBJ_LABEL,0,0 ;)
ObjectSet(name,OBJPROP_CORNER,n) ;
ObjectSet(name,OBJPROP_XDISTANCE,X) ;
ObjectSet(name, OBJPROP_YDISTANCE,Y) ;
ObjectSetText(name,CharToStr(cod), rsm, "Wingdings",color_trend) ;
}
void Commen(string name, string txt, int n, int X, int Y, string shrift, color clr, int rsm)
{
ObjectCreate(name,OBJ_LABEL,0,0,0) ;
ObjectSet(name,OBJPROP_CORNER,n) ;
ObjectSet(name,OBJPROP_XDISTANCE,X) ;
ObjectSet(name, OBJPROP_YDISTANCE,Y) ;
ObjectSetText(name,txt, rsm,shrift,clr) ;
}

+++++++++++++++++++++++++++++++++++++++++++ et affichage

 
nlp2311:

...

+++++++++++++++++++++++++++++++++++++++++++ et sortie


"+++++++++++++++++++++++++++++++++++++++++++ et sortie sur l'écran"

Et apprenez à insérer le code correctement. Votre fiche n'est d'aucun intérêt pour quiconque...

Lisez l'intégralité de l'article ici.

 
J'ai oublié mon mot de passe dans Metatrader, comment puis-je en créer un nouveau, qui puis-je contacter ?
Raison: