Isto é o que eu recebo quando tento o modo multiuso (o indicador do poste acima)
ATENÇÃO: O vídeo deve ser recarregado
ATENÇÃO: O vídeo deve ser recarregado
Tanto quanto eu vejo, tudo funciona como deveria funcionar
Mladen
Peço desculpas por não apresentar meu problema com clareza. Sua correção sobre os diff_Levelms 0.0 funcionando corretamente, mas a adição de diff_Levelms foi para permitir que pequenas mudanças, tais como variação de 0.0002 para EURUSD ou 0.02 para USDJPY. Aparentemente, meu cálculo de dif não está sendo usado pelo cálculo de tendência1.
if (ma1[i]>ma2[i]) trendfm[i] =1; if (ma1[i]<ma2[i]) trendfm[i] =-1; if (ma1[i]>ma3[i]) trendfs[i] =1; if (ma1[i]<ma3[i]) trendfs[i] =-1; if (ma2[i]>ma3[i] && diffums > diff_Levelms) trendms[i] =1; não sendo usado pelo cálculo da trend1 se (ma2[i]<ma3[i] && diffdms > diff_Levelms) trend[i] =-1; não sendo usado pelo cálculo da trend1
Meu amigo escreveu esta EA com base no indicador de vértice, não pudemos fazer um teste de retorno depois que ele a criou. Por favor, você pode me ajudar a corrigir o erro que impede que ele possa recuar. mas ele requer muita atualização uma vez que é limpo
Obrigado e humildemente aprendido
// ------------------------------------------------------------------------------------------------// ------------------------------------------------------------------------------------------------#include <stdlib.mqh>
#include <stderror.mqh>
#property copyright"reddevil"#property link""#property version"3.0";
// 19-09 minimum of 4 periods before the next order.// v1.2 check alternate timeframe for spike// v2.0 uses 3.01a indicator with alternate timeframe//v3.0 red crossing blue as entry// trailing after line cross// ------------------------------------------------------------------------------------------------// VARIABLES EXTERNAS// ------------------------------------------------------------------------------------------------//// check for candle externint magic = 668899;
string progName="VertexPro3";
string key = "vertex 3.0";
// Configurationexternstring CommonSettings = "---------------------------------------------";
externint user_slippage = 2;
externdouble max_spread = 3.0;
externint user_tp = 0; // min TPexternint user_sl = 50; // max SL//extern int AlternateTF = 30 ; // 30 minsexterndouble Entry_line =10; // 10 sell, -10 buy// extern double Entry_pips = 10; // from highest high or lowest lowexternstring TakeProfit_trigger ="------------------------------------------";
externint TPdefault_line =25;
externdouble BBvalue1 =10.0;
externint BBTP_line =15;
//extern bool DailyFilter=true;externbool NewsFilter=false;
externint MinsBeforeNews=1440;
externint MinsAfterNews=60;
externint maxOrders=3; //max 3externstring Trailing = "----------------------------------------------------";
externint UseTrailing=2 ; // 0 - no trailing, 1- normal; 2-trail after TP lineexternint TrailStartPips=8;
externint Trailpips=5;
externint TrailStepPips=3;
externstring MoneyManagementSettings = "---------------------------------------------";
// Money Managementexternbool money_management = false;
externdouble min_lots = 0.1;
externint risk=1;
externint progression = 0; // 0=none | 1:ascending | 2:martingaleexternint GMToffset=2;
int arrLgt=3;
int buy_magic[3];
int sell_magic[3];
int buy_tickets[3];
int sell_tickets[3];
// Lotsdouble buy_lots[3];
double sell_lots[3];
// Current Profitdouble buy_profit[3];
double sell_profit[3];
//SLdouble sell_sl[3];
double buy_sl[3];
//TPdouble sell_tp[3];
double buy_tp[3];
// Open Pricedouble buy_price[3];
double sell_price[3];
datetime buy_time; // last buytimedatetime sell_time;
// Indicatordouble rsi=0;
// Number of ordersint buys = 0;
int sells = 0;
double total_buy_profit=0,total_sell_profit=0;
double total_buy_lots=0, total_sell_lots=0;
double buy_max_profit=0, buy_close_profit=0;
double sell_max_profit=0, sell_close_profit=0;
// Indicator// ------------------------------------------------------------------------------------------------// VARIABLES GLOBALES// ------------------------------------------------------------------------------------------------// indicadores// Cantidad de ordenes;int orders = 0;
int direction= 0;
double max_profit=0, close_profit=0;
double last_order_profit=0, last_order_lots=0;
// Colorescolor c=Black;
// Cuentadouble balance, equity;
int slippage=0;
// OrderReliableint OldHist=0;
double SL,PT,_spread;
int newMagic1,newMagic2;
int curMagic;
int Tframe = PERIOD_H1;
datetime OldTime;
int _DSTtime=0;
int pendingTicket=-1;
bool NoNews=true;
int mBefore, mAfter;
// ------------------------------------------------------------------------------------------------// START//void init()
{
if (Digits==4 || Digits==2)
{
slippage = user_slippage;
PT=Point;
}
elseif (Digits==5 || Digits==3)
{
slippage = 10*user_slippage;
PT=Point*10;
}
if(maxOrders > 3) maxOrders=3;
newMagic1 = StrToInteger(IntegerToString(TPdefault_line) + IntegerToString(magic));
newMagic2 = StrToInteger(IntegerToString(BBTP_line) + IntegerToString(magic));
}
int start()
{
double point = MarketInfo(Symbol(), MODE_POINT);
double dd=0;
string DST = "Yes";
bool encontrada;
balance=AccountBalance();
equity=AccountEquity();
if(TimeCurrent() - OldTime > 25)
{
RefreshRates();
OldTime=TimeCurrent();
}
_spread = NormalizeDouble(MathAbs(Ask-Bid)/PT,2);
if(IsTradeAllowed() == false)
{
Comment("nTrade not allowed.");
return(0);
}
/*if(StringLen(DoubleToStr(TPdefault_line)) > 3 || StringLen(DoubleToStr(BBTP_line)) > 3)
{
Comment("nTPdefault or BBTP too long");
return(1);
} */if(BBTP_line > TPdefault_line)
{
Comment("nBBTP must be less than TPdefault");
return(1);
}
/*if(!IsTesting())
if (Period() != Tframe)
{
Comment("\n ERROR :: Invalid Timeframe, Please Switch to "+ IntegerToString(Tframe));
return(0);
} */if(TimeDaylightSavings()==0)
{
DST="No";
}
else _DSTtime=1;
if(!IsTesting())
{
//Comment(StringConcatenate("\nLSMA02a is running.\nNext order lots: ",CalcularVolumen(),"\nTake profit ($): ",CalcularVolumen()*10*user_tp,"\nStop loss ($): ",CalcularVolumen()*10*user_sl,"\nSpread: ",_spread, "\nDST: ",DST));Comment(StringConcatenate("\n",progName," is running.\nNext order lots: ",CalcularVolumen(),
"\nTake profit ($): ",CalcularVolumen()*10*user_tp,
"\nStop loss ($): ",CalcularVolumen()*10*user_sl,
"\nSpread: ",_spread,
"\nDST: ",DST,
"\nMax Orders: ",maxOrders,
// "\nDailyFilter ",DailyFilter,"\nNewsFilter: ",NewsFilter,
"\nMins Before News: ",mBefore,
"\nMins After News: ",mAfter));
}
// Actualizamos el estado actual
InitBuy();
InitSell();
UpdateVars();
encontrada=FALSE;
point = Point;
Robot();
return(0);
}
void InitBuy()
{
// Reset number of buy/sell orders
buys=0;
// Reset arraysfor(int i=0; i<arrLgt; i++)
{
buy_tickets[i] = 0;
buy_lots[i] = 0;
buy_profit[i] = 0;
buy_price[i] = 0;
buy_sl[i]=0;
buy_tp[i]=0;
buy_magic[i]=0;
}
}
void InitSell()
{
// Reset number of buy/sell orders
sells=0;
// Reset arraysfor(int i=0; i<arrLgt; i++)
{
sell_tickets[i] = 0;
sell_lots[i] = 0;
sell_profit[i] = 0;
sell_price[i] = 0;
sell_sl[i]=0;
sell_tp[i]=0;
sell_magic[i]=0;
}
}
void UpdateVars()
{
int aux_buys=0, aux_sells=0;
double aux_total_buy_profit=0, aux_total_sell_profit=0;
double aux_total_buy_lots=0, aux_total_sell_lots=0;
buy_time=0;
sell_time=0;
datetime oTime;
// We are going to introduce data from opened orders in arrays for(int i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == true)
if(OrderSymbol() == Symbol() && (OrderMagicNumber() == newMagic1 ||OrderMagicNumber() == newMagic2) )
{
if( OrderType() == OP_BUY)
{
buy_tickets[aux_buys] = OrderTicket();
buy_lots[aux_buys] = OrderLots();
buy_profit[aux_buys] = OrderProfit()+OrderCommission()+OrderSwap();
buy_price[aux_buys] = OrderOpenPrice();
buy_sl[aux_buys] = OrderStopLoss();
buy_tp[aux_buys] = OrderTakeProfit();
aux_total_buy_profit = aux_total_buy_profit + buy_profit[aux_buys];
aux_total_buy_lots = aux_total_buy_lots + OrderLots();
oTime =OrderOpenTime();
buy_magic[aux_buys]=OrderMagicNumber();
if(oTime > buy_time)
buy_time = oTime;
aux_buys++;
}
elseif( OrderType() == OP_SELL)
{
sell_tickets[aux_sells] = OrderTicket();
sell_lots[aux_sells] = OrderLots();
sell_profit[aux_sells] = OrderProfit()+OrderCommission()+OrderSwap();
sell_price[aux_sells] = OrderOpenPrice();
sell_sl[aux_sells] = OrderStopLoss();
sell_tp[aux_sells] = OrderTakeProfit();
aux_total_sell_profit = aux_total_sell_profit + sell_profit[aux_sells];
aux_total_sell_lots = aux_total_sell_lots + OrderLots();
oTime =OrderOpenTime();
sell_magic[aux_sells]=OrderMagicNumber();
if(oTime > sell_time)
sell_time = oTime;
aux_sells++;
}
}
}
// Update global vars
buys = aux_buys;
sells = aux_sells;
total_buy_profit = aux_total_buy_profit;
total_sell_profit = aux_total_sell_profit;
total_buy_lots = aux_total_buy_lots;
total_sell_lots = aux_total_sell_lots;
}
Sou novo neste site, e posso ver seus bons trabalhos, continue assim, mano. No entanto, gostaria que me ajudassem com algumas codificações para transformar um indicador em um EA.
Tudo o que eu realmente preciso é que o EA compre ou venda quando o sinal aparecer.
A idéia é ir a um prazo maior, 4hrs tf e encontrar a tendência do mercado (apenas para conhecer a tendência) e negociar em tf mais baixa (15-5mins). Portanto, se for curto, só nos resta curto até a mudança de tendência o prazo mais alto.
mladen: Favor anexar o arquivo mq4 - desta forma os usuários não poderão testá-lo facilmente e então não poderão ajudá-lo
Carregado, por favor, qualquer pessoa pode consultar este código para saber por que ele não pode voltar a testar, os resultados podem não ser lucrativos, mas eu serei grato.
MECMAN: Carregado, por favor, qualquer pessoa pode consultar este código para saber por que ele não pode voltar a testar, os resultados podem não ser lucrativos, mas eu serei grato.
Está funcionando (desde que você tenha o indicador "vertex_mod_3.01" na pasta de indicadores)
Ray
Experimente agora
Mladen
Ainda sem mudanças. Podemos tentar novamente?
Isto é tudo o que fiz para o 2MA;
double fastMA = iMA(NULL,0,FastMa,FastMaShift,FastMaMethod,FastMaPrice,i);
duplo slowMA = iMA(NULL,0,SlowMa,SlowMaShift,SlowMaMethod,SlowMaPrice,i);
UpH[i] = VAZIO_VALOR;
DnH[i] = EMPTY_VALUE;
trend[i] = tendência[i+1];
diffu duplo = (fastMA - slowMA);
diffd duplo = (slowMA - fastMA);
if (diffu > diff_Level ) trend[i] = 1;
if (difd > dif_Level ) trend[i] = -1;
Obrigado
Ray
Mladen
Ainda sem mudanças. Podemos tentar novamente?
Isto é tudo o que fiz para o 2MA;
double fastMA = iMA(NULL,0,FastMa,FastMaShift,FastMaMethod,FastMaPrice,i);
duplo slowMA = iMA(NULL,0,SlowMa,SlowMaShift,SlowMaMethod,SlowMaPrice,i);
UpH[i] = VAZIO_VALOR;
DnH[i] = EMPTY_VALUE;
trend[i] = tendência[i+1];
diffu duplo = (fastMA - slowMA);
diffd duplo = (slowMA - fastMA);
if (diffu > diff_Level ) trend[i] = 1;
if (difd > dif_Level ) trend[i] = -1;
Obrigado
Ray
Isto é o que eu recebo quando tento o modo multiuso (o indicador do poste acima)
Tanto quanto eu vejo, tudo funciona como deveria funcionar
Isto é o que eu recebo quando tento o modo multiuso (o indicador do poste acima)
Mladen
Peço desculpas por não apresentar meu problema com clareza. Sua correção sobre os diff_Levelms 0.0 funcionando corretamente, mas a adição de diff_Levelms foi para permitir que pequenas mudanças, tais como variação de 0.0002 para EURUSD ou 0.02 para USDJPY. Aparentemente, meu cálculo de dif não está sendo usado pelo cálculo de tendência1.
difusores duplos = (ma2[i]-ma3[i]); //med-slow Aparentemente, meu cálculo
difdmsduplos = (ma3[i]-ma2[i]);//slow - med Aparentemente meu cálculo
if (ma1[i]>ma2[i]) trendfm[i] =1;
if (ma1[i]<ma2[i]) trendfm[i] =-1;
if (ma1[i]>ma3[i]) trendfs[i] =1;
if (ma1[i]<ma3[i]) trendfs[i] =-1;
if (ma2[i]>ma3[i] && diffums > diff_Levelms) trendms[i] =1; não sendo usado pelo cálculo da trend1
se (ma2[i]<ma3[i] && diffdms > diff_Levelms) trend[i] =-1; não sendo usado pelo cálculo da trend1
Obrigado
raio
indicador não atualiza
Eu baixei o indicador "Outsidebar Trendline V2" em anexo, mas por alguma razão ele não é atualizado em
a próxima barra/candelabro. Ao trocar de horário funciona bem, mas na barra seguinte, nesse momento, já não funciona mais.
Algum especialista de vocês poderia ajudar para que o indicador se refresque também nas próximas barras?
Muito obrigado.
Lea
mladen,
Meu amigo escreveu esta EA com base no indicador de vértice, não pudemos fazer um teste de retorno depois que ele a criou. Por favor, você pode me ajudar a corrigir o erro que impede que ele possa recuar. mas ele requer muita atualização uma vez que é limpo
Obrigado e humildemente aprendido
E esta é a continuação
E esta é a continuação
HEY MLADEN
Sou novo neste site, e posso ver seus bons trabalhos, continue assim, mano. No entanto, gostaria que me ajudassem com algumas codificações para transformar um indicador em um EA.
Tudo o que eu realmente preciso é que o EA compre ou venda quando o sinal aparecer.
A idéia é ir a um prazo maior, 4hrs tf e encontrar a tendência do mercado (apenas para conhecer a tendência) e negociar em tf mais baixa (15-5mins). Portanto, se for curto, só nos resta curto até a mudança de tendência o prazo mais alto.
Obrigado antecipadamente.
Favor anexar o arquivo mq4 - desta forma os usuários não poderão testá-lo facilmente e então não poderão ajudá-lo
Carregado, por favor, qualquer pessoa pode consultar este código para saber por que ele não pode voltar a testar, os resultados podem não ser lucrativos, mas eu serei grato.
Está funcionando (desde que você tenha o indicador "vertex_mod_3.01" na pasta de indicadores)