traducir variables de un EA al español

Foro dedicado a todo lo relacionado con la versión 4 de la plataforma de Metaquotes.
Responder
Avatar de Usuario
eurer
Mensajes: 789
Registrado: 09 May 2005 16:05
Ubicación: Tenerife

traducir variables de un EA al español

Mensaje por eurer »

Hola, no sé si es ruso o que idioma, a ver si alguien conoce alguna aplicación online, web, lo que sea.. eso sí,que sea la traducción lo más fiable y exacta posible.
Pongo el código...
Sólo traducir lo que he puesto en negrita...igual no es ruso y es otro idioma...
Gracias.

//+------------------------------------------------------------------+
//| TrailingStopFrCnSAR.mq4 |
//| Copyright © 2010, Õëûñòîâ Âëàäèìèð |
//| http://cmillion.narod.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2010, [email protected]"
#property link "http://cmillion.narod.ru"
#property show_inputs
//--------------------------------------------------------------------
extern string parameters.trailing="0-off 1-Candle 2-Fractals 3-Velocity 4-Parabolic >4-pips";
extern int TrailingStop = 2; //0 off
extern int StepTrall = 5; //øàã òðàëëà, ïåðåìåùåíèå íå ìåíåå ÷åì íà StepTrall ï
extern int delta = 0; //îòñòóï îò ôðàêòàëà èëè ñâå÷è èëè Parabolic
extern bool only_Profit = true; //òðàëèòü òîëüêî ïðèáûëüíûå îðäåðà
extern bool only_NoLoss = false; //âìåñòî òðàëëà ïðîñòî ïåðåâîäèòü â áåçóáûòîê
extern bool only_SL = false; //òðàëèòü òîëüêî òå îðäåðà, ó êîòîðûõ óæå åñòü SL
extern bool SymbolAll = true; //òðåéëèòü âñå èíñòðóìåíòû
extern bool Portfel = true; //ïî ïîðòôåëüíîìó ïðîôèòó
extern string parameters.Parabolic = "";
extern double Step = 0.02;
extern double Maximum = 0.2;
extern int Magic = 0;
extern bool visualization = true;
extern int VelocityPeriodBar = 30;
extern double K_Velocity = 1.0; //êîýôôèöèåíò óâåëè÷åíèÿ ñòîïëîññà ïî Velocity
//--------------------------------------------------------------------
int STOPLEVEL,n,DIGITS;
double BID,ASK,POINT;
string SymbolTral,TekSymbol;
//--------------------------------------------------------------------
int start()
{
SymbolTral = Symbol();
ObjectCreate("info",OBJ_LABEL,0,0,0);
ObjectSet("info",OBJPROP_CORNER,2);
ObjectSet("info",OBJPROP_XDISTANCE,0);
ObjectSet("info",OBJPROP_YDISTANCE,15);
ObjectCreate("info1",OBJ_LABEL,0,0,0);
ObjectSet("info1",OBJPROP_CORNER,2);
ObjectSet("info1",OBJPROP_XDISTANCE,0);
ObjectSet("info1",OBJPROP_YDISTANCE,5);
ObjectSetText("info1","Copyright © 2010, [email protected]",8,"Arial",Gold);
string Simb,txt="Óñòàíîâêè TrailingStop ";
if (TrailingStop==1) txt=StringConcatenate(txt,"ïî ñâå÷àì","\n");
if (TrailingStop==2) txt=StringConcatenate(txt,"ïî Fractals","\n");
if (TrailingStop==3) txt=StringConcatenate(txt,"ïî Velocity","\n");
if (TrailingStop==4) txt=StringConcatenate(txt,"ïî Parabolic","\n");
if (TrailingStop> 4) txt=StringConcatenate(txt,"ïî ",TrailingStop," ïóíêò","\n");
if (Magic==0) txt=StringConcatenate(txt,"Magic ëþáîé","\n");
else txt=StringConcatenate(txt,"Magic ",Magic,"\n");
if (SymbolAll) {txt=StringConcatenate(txt,"Âñå èíñòðóìåíòû","\n");Simb=" All Symbols";}
else Simb=StringConcatenate(" ",SymbolTral);

if (Portfel) txt=StringConcatenate(txt,"òðàëèòü îò óðîâíÿ áåçóáûòêà","\n");
if (only_Profit) txt=StringConcatenate(txt,"òîëüêî ïðèáûëüíûå îðäåðà","\n");
if (only_NoLoss) txt=StringConcatenate(txt,"òîëüêî ïåðåâîä â áåçóáûòîê","\n");
if (only_SL) txt=StringConcatenate(txt,"òîëüêî îðäåðà ñ âûñòàâëåííûì SL","\n");

while(true)
{
RefreshRates();
STOPLEVEL=MarketInfo(SymbolTral,MODE_STOPLEVEL);
if (TrailingStop<STOPLEVEL) TrailingStop=STOPLEVEL;
if (ObjectFind("info1")==-1 || ObjectFind("info")==-1) break;
TrailingStop();
ObjectSetText("info",StringConcatenate("Orders ", n,Simb),8,"Arial",Gold);
if (n==0) break;
Sleep(500);
Comment(txt);
}
Comment("Çàêðûòèå ñêðèïòà ",TimeToStr(TimeCurrent(),TIME_SECONDS));
ObjectDelete("info");
ObjectDelete("info1");
ObjectDelete("SL Buy");
ObjectDelete("STOPLEVEL-");
ObjectDelete("SL Sell");
ObjectDelete("STOPLEVEL+");
ObjectDelete("NoLossSell");
ObjectDelete("NoLossSell_");
ObjectDelete("NoLossBuy");
ObjectDelete("NoLossBuy_");
}
//--------------------------------------------------------------------
void TrailingStop()
{
int tip,Ticket;
bool error;
double StLo,OSL,OOP,NoLoss;
n=0;
for (int i=OrdersTotal(); i>=0; i--)
{ if (OrderSelect(i, SELECT_BY_POS)==true)
{ tip = OrderType();
TekSymbol=OrderSymbol();
if (tip<2 && (TekSymbol==SymbolTral || SymbolAll) && (OrderMagicNumber()==Magic || Magic==0))
{
/* if (visualization && TekSymbol==SymbolTral)
{
ObjectDelete("SL Buy"); ObjectDelete("STOPLEVEL-");
ObjectDelete("SL Sell"); ObjectDelete("STOPLEVEL+");
ObjectDelete("NoLossSell"); ObjectDelete("NoLossBuy");
ObjectDelete("NoLossSell_");ObjectDelete("NoLossBuy_");
}*/
POINT = MarketInfo(TekSymbol,MODE_POINT);
DIGITS = MarketInfo(TekSymbol,MODE_DIGITS);
BID = MarketInfo(TekSymbol,MODE_BID);
ASK = MarketInfo(TekSymbol,MODE_ASK);
OSL = OrderStopLoss();
OOP = OrderOpenPrice();
Ticket = OrderTicket();
if (tip==OP_BUY)
{ n++;
if (Portfel) NoLoss = TProfit(1,TekSymbol);
OrderSelect(i, SELECT_BY_POS);
StLo = SlLastBar(1,BID);
if ((StLo < NoLoss && Portfel) || NoLoss==0) continue;
if (StLo < OOP && only_Profit && !Portfel) continue;
if (OSL >= OOP && only_NoLoss) continue;
if (OSL == 0 && only_SL) continue;
if (StLo > OSL+StepTrall*Point)
{ error=OrderModify(Ticket,OOP,NormalizeDouble(StLo,DIGITS),OrderTakeProfit(),0,White);
Comment(TekSymbol," TrailingStop ",Ticket," ",TimeToStr(TimeCurrent(),TIME_MINUTES));
if (!error) Print(TekSymbol," Error order ",Ticket," TrailingStop ",
GetLastError()," ",SymbolTral," SL ",StLo);
}
}
if (tip==OP_SELL)
{ n++;
if (Portfel) NoLoss = TProfit(-1,TekSymbol);
OrderSelect(i, SELECT_BY_POS);
StLo = SlLastBar(-1,ASK);
if (StLo > NoLoss && Portfel) continue;
if (StLo==0) continue;
if (StLo > OOP && only_Profit && !Portfel) continue;
if (OSL <= OOP && only_NoLoss) continue;
if (OSL == 0 && only_SL) continue;
if (StLo < OSL-StepTrall*Point || OSL==0 )
{ error=OrderModify(Ticket,OOP,NormalizeDouble(StLo,DIGITS),OrderTakeProfit(),0,White);
Comment(TekSymbol," TrailingStop "+Ticket," ",TimeToStr(TimeCurrent(),TIME_MINUTES));
if (!error) Print(TekSymbol," Error order ",Ticket," TrailingStop ",
GetLastError()," ",SymbolTral," SL ",StLo);
}
}
}
}
}
}
//--------------------------------------------------------------------
double SlLastBar(int tip,double price)
{
double fr=0;
int jj,ii;
if (TrailingStop>4)
{
if (tip==1) fr = price - TrailingStop*POINT;
else fr = price + TrailingStop*POINT;
}
else
{
//------------------------------------------------------- òðàëë ïî ôðàêòàëàì
if (TrailingStop==2)
{
if (tip== 1)
for (ii=1; ii<100; ii++)
{
fr = iFractals(TekSymbol,0,MODE_LOWER,ii);
if (fr!=0) {fr-=delta*POINT; if (price-STOPLEVEL*POINT > fr) break;}
else fr=0;
}
if (tip==-1)
for (jj=1; jj<100; jj++)
{
fr = iFractals(TekSymbol,0,MODE_UPPER,jj);
if (fr!=0) {fr+=delta*POINT; if (price+STOPLEVEL*POINT < fr) break;}
else fr=0;
}
}
//------------------------------------------------------- òðàëë ïî ñâå÷àì
if (TrailingStop==1)
{
if (tip== 1)
for (ii=1; ii<100; ii++)
{
fr = iLow(TekSymbol,0,ii)-delta*POINT;
if (fr!=0) if (price-STOPLEVEL*POINT > fr) break;
else fr=0;
}
if (tip==-1)
for (jj=1; jj<100; jj++)
{
fr = iHigh(TekSymbol,0,jj)+delta*POINT;
if (fr!=0) if (price+STOPLEVEL*POINT < fr) break;
else fr=0;
}
}
//------------------------------------------------------- òðàëë ïî ñêîðîñòè
if (TrailingStop==3)
{
double Velocity_0 = iCustom(TekSymbol,0,"Velocity",VelocityPeriodBar,2,0);
double Velocity_1 = iCustom(TekSymbol,0,"Velocity",VelocityPeriodBar,2,1);
if (tip== 1)
{
if(Velocity_0>Velocity_1) fr = price - (delta-Velocity_0+Velocity_1)*POINT*K_Velocity;
else fr=0;
}
if (tip==-1)
{
if(Velocity_1>Velocity_0) fr = price + (delta+Velocity_1-Velocity_0)*POINT*K_Velocity;
else fr=0;
}
}
//------------------------------------------------------- òðàëë ïî ïàðàáîëèêó
if (TrailingStop==4)
{
double PSAR = iSAR(TekSymbol,0,Step,Maximum,0);
if (tip== 1)
{
if(price-STOPLEVEL*POINT > PSAR) fr = PSAR - delta*POINT;
else fr=0;
}
if (tip==-1)
{
if(price+STOPLEVEL*POINT < PSAR) fr = PSAR + delta*POINT;
else fr=0;
}
}
}
//-------------------------------------------------------
if (visualization && TekSymbol==SymbolTral)
{
if (tip== 1)
{
if (fr!=0){
ObjectCreate("SL Buy",OBJ_ARROW,0,Time[0]+Period()*60,fr,0,0,0,0);
ObjectSet ("SL Buy",OBJPROP_ARROWCODE,6);
ObjectSet ("SL Buy",OBJPROP_COLOR, Blue);}
if (STOPLEVEL>0){
ObjectCreate("STOPLEVEL-",OBJ_ARROW,0,Time[0]+Period()*60,price-STOPLEVEL*POINT,0,0,0,0);
ObjectSet ("STOPLEVEL-",OBJPROP_ARROWCODE,4);
ObjectSet ("STOPLEVEL-",OBJPROP_COLOR, Blue);}
}
if (tip==-1)
{
if (fr!=0){
ObjectCreate("SL Sell",OBJ_ARROW,0,Time[0]+Period()*60,fr,0,0,0,0);
ObjectSet ("SL Sell",OBJPROP_ARROWCODE,6);
ObjectSet ("SL Sell", OBJPROP_COLOR, Pink);}
if (STOPLEVEL>0){
ObjectCreate("STOPLEVEL+",OBJ_ARROW,0,Time[0]+Period()*60,price+STOPLEVEL*POINT,0,0,0,0);
ObjectSet ("STOPLEVEL+",OBJPROP_ARROWCODE,4);
ObjectSet ("STOPLEVEL+",OBJPROP_COLOR, Pink);}

}
}
return(fr);
}
//-------------------------------------------------------------------- âû÷èñëåíèå îáùåãî (ïîðòôåëüíîãî) TP
double TProfit(int tip,string Symb)
{
int b,s;
double price,price_b,price_s,lot,SLb,SLs,lot_s,lot_b;
for (int j=0; j<OrdersTotal(); j++)
{ if (OrderSelect(j,SELECT_BY_POS,MODE_TRADES)==true)
{ if ((Magic==OrderMagicNumber() || Magic==0) && OrderSymbol()==Symb)
{
price = OrderOpenPrice();
lot = OrderLots();
if (OrderType()==OP_BUY ) {price_b += price*lot; lot_b+=lot; b++;}
if (OrderType()==OP_SELL) {price_s += price*lot; lot_s+=lot; s++;}
}
}
}
//--------------------------------------
if (b!=0)
{ SLb = price_b/lot_b;
if (visualization && Symb==SymbolTral){
ObjectCreate("NoLossBuy",OBJ_ARROW,0,Time[0]+Period()*60*5,SLb,0,0,0,0);
ObjectSet ("NoLossBuy",OBJPROP_ARROWCODE,6);
ObjectSet ("NoLossBuy",OBJPROP_COLOR, Blue);
ObjectCreate("NoLossBuy_",OBJ_ARROW,0,Time[0]+Period()*60*5,SLb,0,0,0,0);
ObjectSet ("NoLossBuy_",OBJPROP_ARROWCODE,200);
ObjectSet ("NoLossBuy_",OBJPROP_COLOR, Blue);}
}
if (s!=0)
{ SLs = price_s/lot_s;
if (visualization && Symb==SymbolTral){
ObjectCreate("NoLossSell",OBJ_ARROW,0,Time[0]+Period()*60*5,SLs,0,0,0,0);
ObjectSet ("NoLossSell",OBJPROP_ARROWCODE,6);
ObjectSet ("NoLossSell",OBJPROP_COLOR, Pink);
ObjectCreate("NoLossSell_",OBJ_ARROW,0,Time[0]+Period()*60*5,SLs,0,0,0,0);
ObjectSet ("NoLossSell_",OBJPROP_ARROWCODE,202);
ObjectSet ("NoLossSell_",OBJPROP_COLOR, Pink);}
}
if (tip== 1) return(SLb);
if (tip==-1) return(SLs);
}
//--------------------------------------------------------------------
MeduTradestation
Mensajes: 21
Registrado: 16 May 2012 23:25

Re: traducir variables de un EA al español

Mensaje por MeduTradestation »

Buenos dias Eurer:

Mas que un idioma yo te diria que es un lenguaje, un lenguaje informatico, te lo comento por que me sucedio algo parecido y no con un codigo de un sistema si no con una descarga de un manual de una maquina, y por lo que me dijo el informatico de mi empresa, que era la mala interpretacion de la maquina "ordenador" ante una serie de simbolos, numeros o letras.
Nunca conseguimos traducirlo como tu dices.
Pero bueno eso no significa que no se pueda.

Un cordial saludo.
kanji
Mensajes: 8
Registrado: 26 Sep 2010 20:24

Re: traducir variables de un EA al español

Mensaje por kanji »

Buenas eurer,

Esos carácteres no son ningún idioma, creo que te aparecen esos carácteres por NO tener instalado en el Sistema Operativo el alfabeto cirílico (ruso).


Diría que es el mismo que tu has puesto, al menos se llaman igual:
Comentarios en Inglés: http://codebase.mql4.com/6907
Comentarios en ruso: http://codebase.mql4.com/ru/6869

Google Translate:
http://translate.google.com/translate?h ... ce%2F23783

Un saludo
Avatar de Usuario
eurer
Mensajes: 789
Registrado: 09 May 2005 16:05
Ubicación: Tenerife

Re: traducir variables de un EA al español

Mensaje por eurer »

Justo es ese EA, y hay dos variables que no entiendo...

only_NoLoss = false; / / instead of simply translating Thrall in bezubytok

está mal traducida... para que sirve esa variable??

sweep significa barrido...supongo que quiere decir hacer trailing...de esto no estoy seguro...
kanji
Mensajes: 8
Registrado: 26 Sep 2010 20:24

Re: traducir variables de un EA al español

Mensaje por kanji »

Lo siento eurer, pero ni idea.

Usando otro traductor da:

only_NoLoss = false; //instead of just translating the break-even thrall

Avatar de Usuario
zamio
Mensajes: 588
Registrado: 04 Ago 2010 09:57

Re: traducir variables de un EA al español

Mensaje por zamio »

only_NoLoss a mi viendo un poco el codigo me da que es un EVEN como bien dice la traduccion ultima.

Osea only_NoLoss = True seria que aqui no se pierde, quizas le falta o no le veo cuando se puede o no activar el Even, pero eso ya es otra historia.

Saludos.
El precio no es mas que el camino marcado por vuestros stoploss.

Analisis tecnico. Videos con previsiones. http://anteforex.blogspot.com.es/" onclick="window.open(this.href);return false;
Si te ha gustado este hilo del Foro, ¡compártelo en redes!


Responder

Volver a “Metatrader 4”