PDA

Ver la versión completa : Necesito ayuda para que mi MoneyMaker EA funcione más rápido



cuannna242
13:30,
Oye, tengo una pregunta para unos pocos programadores de metatrader realmente excelentes. Dentro de mi EAI cambiar entre los marcos de tiempo dependiendo de una función. Si el EA determina que debo estar usando los marcos de tiempo de 15 minutos, entonces llama a RangePrefetch () justo después del inicio (). Si necesito utilizar gráficos de 1 hora, el EA llama a TrendPrefetch () justo después de comenzar (). Los dos RangePrefetch () y TrendPrefetch () serían exactamente iguales a excepción del período de tiempo, y se definen y son apropiados después de init ().

El problema es que, como resultado de este cambio entre los marcos de tiempo, lleva mucho más tiempo examinarlo y optimizarlo. Así que me pregunto si hay algún método para reorganizar el código o simplemente codificarlo de una manera más eficiente para que todo se ejecute mucho más rápido. Muchas gracias.

Código insertado extern doble JumpWidth_Percen = 0.25; cadena de tendencia, comprar, vender, TradeComm; doble Cerrar1, Cerrar2, Cerrar3, Cerrar4, Cerrar5, Cerrar6, Abrir1, Abrir2, Abrir3, Abrir4, Abrir5, Abrir6, Rápido1, Rápido2, Rápido3, Rápido5, Rápido5, Rápido6, Lento1, Lento2, Lento3, Lento3, Lento4, Lento5, Lento6, Promedio , FastW, Currency_momentumA, Currency_momentumB, Currency_momentumC, Trend_momentumFastA, Trend_momentumFastB, Trend_momentumFastC, Trend_momentumFastD, Trend_momentumSlowA, Trend_momentumSlowB, Width1, anchura2, Width3, Width4, width5, Width6, WidthW1, WidthW2, WidthW3, WidthW4, WidthW5, WidthW6, FastTrend, SlowTrend; int Trendd, MaxpipfromEMA, Ranging, RangingS, TFTime; void TrendPreFetch () Promedio = iMA (NULL, PERIOD_H1,3,0, MODE_EMA, PRICE_CLOSE, 1); FastW = iMA (NULL, PERIOD_H1, fastma * 3.8,0, MODE_EMA, PRICE_CLOSE, 1); Currency_momentumA = iCustom (NULL, PERIOD_H1, OSMAMA, 4,6, currency_momentum, 1, currency_momentum, 0,1); Currency_momentumB = iCustom (NULL, PERIOD_H1, OSMAMA, 4,6, currency_momentum, 1, currency_momentum, 1,1); Currency_momentumC = iCustom (NULL, PERIOD_H1, OSMAMA, 4,6, currency_momentum, 1, currency_momentum, 0,5); Trend_momentumFastA = iCustom (NULL, PERIOD_H1, OSMAMA, 4,6, trend_momentum, 1, trend_momentum, 0,1); Trend_momentumFastB = iCustom (NULL, PERIOD_H1, OSMAMA, 4,6, trend_momentum, 1, trend_momentum, 0,2); Trend_momentumFastC = iCustom (NULL, PERIOD_H1, OSMAMA, 4,6, trend_momentum, 1, trend_momentum, 0,3); Trend_momentumFastD = iCustom (NULL, PERIOD_H1, OSMAMA, 4,6, trend_momentum, 1, trend_momentum, 1,1); Trend_momentumSlowA = iCustom (NULL, PERIOD_H1, OSMAMA, 6,8, slowma * 3, currency_momentum * 3, currency_momentum * 3,0,1); Trend_momentumSlowB = iCustom (NULL, PERIOD_H1, OSMAMA, 6,8, slowma * 3, currency_momentum * 3, currency_momentum * 3,0,5); void RangePreFetch () Promedio = iMA (NULL, PERIOD_M15,3,0, MODE_EMA, PRICE_CLOSE, 1); FastW = iMA (NULL, PERIOD_M15, fastma * 3.8,0, MODE_EMA, PRICE_CLOSE, 1); Currency_momentumA = iCustom (NULL, PERIOD_M15, OSMAMA, 4,6, currency_momentum, 1, currency_momentum, 0,1); Currency_momentumB = iCustom (NULL, PERIOD_M15, OSMAMA, 4,6, currency_momentum, 1, currency_momentum, 1,1); Currency_momentumC = iCustom (NULL, PERIOD_M15, OSMAMA, 4,6, currency_momentum, 1, currency_momentum, 0,5); Trend_momentumFastA = iCustom (NULL, PERIOD_M15, OSMAMA, 4,6, trend_momentum, 1, trend_momentum, 0,1); Trend_momentumFastB = iCustom (NULL, PERIOD_M15, OSMAMA, 4,6, trend_momentum, 1, trend_momentum, 0,2); Trend_momentumFastC = iCustom (NULL, PERIOD_M15, OSMAMA, 4,6, trend_momentum, 1, trend_momentum, 0,3); Trend_momentumFastD = iCustom (NULL, PERIOD_M15, OSMAMA, 4,6, trend_momentum, 1, trend_momentum, 1,1); Trend_momentumSlowA = iCustom (NULL, PERIOD_M15, OSMAMA, 6,8, slowma * 3, currency_momentum * 3, currency_momentum * 3,0,1); Trend_momentumSlowB = iCustom (NULL, PERIOD_M15, OSMAMA, 6,8, slowma * 3, currency_momentum * 3, currency_momentum * 3,0,5);int start () {double Averagepips, Opentime, Stopip; int I, open, Spike, SpikeW, Buyjump, Selljump, BuyjumpR, SelljumpR, Ticket, Cnt, Can; doble SlowTrend = iMA (NULL, PERIOD_H1, slowma, 0, MODE_EMA, PRICE_CLOSE, 1); doble FastTrend = iMA (NULL, PERIOD_H1, fastma, 0, MODE_EMA, PRICE_CLOSE, 1); if ((MathAbs (FastTrend-SlowTrend) gt; RangePoint * Point)) RangingS = 2; else RangingS = 1; if ((TFTime! = iTime (Symbol (), PERIOD_M15,1)) (RangingS == 1)) RangePreFetch (); MaxpipfromEMA = MaxpipfromEMAM; Rango = 1; TFTime = iTime (Symbol (), PERIOD_M15,1); if ((TFTime! = iTime (Symbol (), PERIOD_H1,1)) (RangingS == 2)) TrendPreFetch (); MaxpipfromEMA = MaxpipfromEMAH; Rango = 0; TFTime = iTime (Symbol (), PERIOD_H1,1);

laelitanool
12:48,
Incluso con la optimización, su EA realmente va a disminuir. Dicho esto, tengo algunas recomendaciones: Calcule esos índices en el último momento posible. En lugar de tener esas declaraciones if, llame a RangePreFetch y TrendPreFetch, haga que coloquen un factor de período en PERIOD_H1 o PERIOD_M15. Calcule los valores iniciales usando su intervalo var a period. En lugar de calcular cada indior para cada tick, es probable que encuentre que solo está calculando dos o menos indiors para la mayoría de los ticks. Maximiza los indiors. Normalmente hay mucho espacio para la optimización en los modelos personalizados. Si tienes la fuente, dale un vistazo.