[¡Archivo!] Cualquier pregunta de novato, para no saturar el foro. Profesionales, no pasen de largo. No puedo ir a ningún sitio sin ti - 4. - página 139

 
CLAIN:

Lo interesante es que el depósito es suficiente: tengo una gran reserva allí.
Inmediatamente después de abrir una posición, emite un error en Print() y ve la razón.
 

Pregunta.

He escrito un indicador. Las funciones principales que se utilizan son Symbol() en todas partes iClose iOpen. Pero por alguna razón, el indicador sólo funciona en EURUSD............ He probado otras herramientas cuelga ((.

La esencia del indicador: muestra información sobre la Cuenta, los Fondos Libres, ko número de lotes a abrir, cuánto está abierto, la relación Beneficio/Riesgo en el dinero, configurado SÓLO si (OrderSymbol()!=Symbol()) continuar;

Reexaminó la razón 10-20 veces. No entiendo... ((((

Gracias de antemano

 
sergeev:

garrapata

Resulta que todos los indicadores en MT4 del grupo de volumen muestran un volumen de ticks?
 
paladin80:
Inmediatamente después de abrir una posición, print() emite un error y ve la razón.


Lo interesante es que no hay problemas en el probador. Desde el año 2000 hasta la fecha ha funcionado sin ninguna fuga.

¿el código ayudaría?

//+------------------------------------------------------------------+ 
//| 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);
         }
      }
   }   
}

Es decir, tengo una función principal aquí y las otras dos simplemente la duplican. Lo he hecho como seguro, pero sigue sin funcionar.

 
CLAIN:


lo interesante es que no hay problemas en el probador. Lleva funcionando desde el año 2000 hasta la fecha sin vaciarse.

¿tal vez el código podría ayudar?

Es decir, tengo una función principal aquí y las otras dos simplemente la duplican. Lo hice para el seguro, pero todavía deja de funcionar

Un código muy extraño. Estoy muy confundido por el hecho de que se abre una posición en la inicialización y la búsqueda de órdenes sin para el operador. No he visto nada parecido antes. Inserte Print () en su código. Créeme, ayuda.
 
CLAIN:


Lo interesante es que en el probador no hay ningún problema. Lleva funcionando desde el año 2000 hasta la fecha sin vaciarse.

¿el código ayudaría?

Es decir, tengo una función principal aquí y las otras dos simplemente la duplican. Lo hice como un seguro, pero todavía deja de funcionar.

Probador: stop loss #68 en 1,2887 (1,2885 / 1,2887)
16:56:31 2010.07.15 15:04 EURUSD,M30: Orderlots = 1
16:56:31 2010.07.15 15:04 Probador: no hay suficiente dinero para comprar 2.00 EURUSD a 1.2887 sl: 1.1885 tp: 1.2905 [2010.07.15 15:04]
16:56:31 2010.07.15 15:04 Tester: 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: OrderSend error 134

Creo que TP=1000 y SL=1000 es demasiado aunque los lotes=1.0))

Intenta poner un lote más pequeño y TP=1000 y creo que estarás contento.

 

¡¡¡¡¡¡¡¡¡GENTE!!!!!!!!! ¡¡Ayuda!! ¡¡¡Por favor, reitera!!! ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡PREGUNTA ENTONCES: POR QUÉ el indicador se abre en MT4 SOLO en EURUSD!!!!!!!!!!!!!!! Qué misterio. No hay restricción de pares en el indicador, Symbol() está en todas partes, las funciones principales en la cuenta Orden y Cuenta. Cuando quito el indicador no funciona también en otro par, o más bien MT4 se cuelga completamente hasta que lo corto. El indicador lo escribí yo mismo. No puedo entender este comportamiento con otros pares. Como es un indicador largo, no quiero mostrarlo. Pero te aseguro que no hay nada antinatural en que funcione sin problemas SOLO en eurodollar???????????????????????

PRO RESOLVER EL ROMPECABEZAS)))))))))))))))))))))))))))))))) No tengo suerte.................

A continuación, un extracto de las funciones utilizadas

++++++++++++++++++++++++++++++++++++ Código de omisión

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

str=StringLen(CuentaEmpresa());
if(str<=31) shf=31-str;
si no
if(str>=31) shf=0;
Commen("NombreCo",CuentaEmpresa(), 1, shf, 40, "Times New Roman", color_Fon,7);
Commen("en",ABC v2, 1, 36, 51, "Times New Roman", color_Fon,11);
Commen("txt_symb",Symbol(), 1, 3, 64, "Times New Roman", color_Fon,16);

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

if(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);

if(Dígitos==2) pips=100;
si no
if(Dígitos==3) pips=1000;
si no
if(Dígitos==4) pips=10000;
si no
if(Dígitos==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);
}
si no
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");
}
si no
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");
}
si no
if(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");
}
si no
if(AccountCurrency()=="USD")
{
EQ_USD= CuentaPatrimonio();
FreeMargin_USD= AccountFreeMargin()-AccountStopoutLevel();
PRF_USD= Cuenta de beneficios();
LOTE_01= Margen libre_USD/(UnLote/10);
LOTE_1= Margen libre_USD/Un lote;
ObjectDelete("nodepo");
}

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

if(Orders_OK==false) order=1;
si no, orden=0;

if(OrdersTotal()>=orden)
{
for(int pos=OrdersTotal(); pos>=0; pos--)
{
if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()!=Symbol()) continuar;
{
SUMM= SUMM+Lotes de pedido();
SWAP=SWAP+OrderSwap();
COMMIS=COMMIS+OrdenComisión();
Precio abierto=Precio abierto+Precio abierto del pedido();

//--- //PEDIDOS A TRAVÉS DE EBAY
if(OrderType()==OP_BUY)
{
baylot= OrderLots();
if(baylot>=1 && baylot<99.0)
{
bSL1= bSL1+(OrderStopLoss());
bTP1= bTP1+(OrderTakeProfit());
bOPN1= bOPN1+(OrderOpenPrice();
if(bSL1>0) bsumL1=bsumL1+1;
if(bTP1>0) bsumP1=bsumP1+1;
if(bOPN1>0) bsumO1=bsumO1+1;
}
if(baylot>=0,1 && baylot<0,99)
{
bSL01= bSL01+(OrderStopLoss());
bTP01= bTP01+(OrderTakeProfit());
bOPN01= bOPN01+(OrderOpenPrice();
if(bSL01>0) bsumL01=bsumL01+1;
if(bTP01>0) bsumP01=bsumP01+1;
if(bOPN01>0) bsumO01=bsumO01+1;
}
} //OP_BUY

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

Función

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;
doble 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);
nombre de la cadena2;
color_tendencia;
bool FLEAT=false;

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

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

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

ObjectCreate(nombre,OBJ_LABEL,0,0;)
ObjectSet(nombre,OBJPROP_CORNER,n);
ObjectSet(nombre,OBJPROP_XDISTANCE,X);
ObjectSet(nombre, 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(nombre,OBJ_LABEL,0,0,0);
ObjectSet(nombre,OBJPROP_CORNER,n);
ObjectSet(nombre,OBJPROP_XDISTANCE,X);
ObjectSet(nombre, OBJPROP_YDISTANCE,Y);
ObjectSetText(nombre,txt, rsm,shrift,clr);
}

+++++++++++++++++++++++++++++++++++++++++++ y la pantalla

 
nlp2311:

...

+++++++++++++++++++++++++++++++++++++++++++ y salida


"+++++++++++++++++++++++++++++++++++++++++++ y salida en pantalla"

Y aprender a insertar el código correctamente. Su hoja no le interesa a nadie...

Léalo todo aquí.

 
He olvidado mi contraseña en Metatrader, ¿cómo puedo crear una nueva, con quién puedo contactar?
 
Processor_ua:
He olvidado mi contraseña en Metatrader, ¿cómo puedo crear una nueva?


Si no has borrado tu correo electrónico, consulta la pestaña del terminal "Buzón" - Registrar una nueva cuenta...

Si lo ha borrado, póngase en contacto con su empresa de corretaje.