PDA

View Full Version : MoneyMaker EA를 더 빨리 실행할 수 있도록 도와주세요.



철아 음메 영 한혜진
03-12-2007 13:30, 01:30 PM
안녕, 정말 좋은 metatrader 프로그래머를위한 질문이 있습니다. EA에서는 기능에 따라 시간대를 전환합니다. EA가 15 분짜리 시간 프레임을 사용해야한다고 판단하면 start () 직후 RangePrefetch ()를 호출합니다. 1 시간 차트를 사용해야하는 경우 EA는 start () 직후에 TrendPrefetch ()를 호출합니다. RangePrefetch ()와 TrendPrefetch ()는 마침표를 제외하고 정확히 동일하며 init () 바로 뒤에 정의되어 있습니다.

이 문제는 시간대에 따라 앞뒤로 전환하기 때문에 테스트하고 최적화하는 데 훨씬 오래 걸립니다. 그래서 코드를 재정렬하거나 더 효율적인 방법으로 코딩하는 방법이 있는지 궁금 해서요. 고마워.

삽입 된 코드 extern double JumpWidth_Percen = 0.25; 문자열 트렌드, 매수, 매도, 트레이드 컴; Open1, Open2, Open3, Open4, Open5, Open6, Fast1, Fast2, Fast3, Fast4, Fast5, Fast6, Slow1, Slow2, Slow3, Slow4, Slow5, Slow6, Average , FastW, Currency_momentumA, Currency_momentumB, Currency_momentumC, Trend_momentumFastA, Trend_momentumFastB, Trend_momentumFastC, Trend_momentumFastD, Trend_momentumSlowA, Trend_momentumSlowB, Width1, Width2, Width3, Width4, 폭 57.5, Width6, WidthW1, WidthW2, WidthW3, WidthW4, WidthW5, WidthW6, FastTrend, SlowTrend; int Trendd, MaxpipfromEMA, Ranging, RangingS, TFTime; void TrendPreFetch () {평균 = 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 () {Average = 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 () {평균 Averagepips, Opentime, Stopip; int i, open, Spike, SpikeW, Buyjump, Selljump, BuyjumpR, SelljumpR, Ticket, Cnt, Can; double SlowTrend = iMA (NULL, PERIOD_H1, 슬로우 마, 0, MODE_EMA, PRICE_CLOSE, 1); double 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; 범위 = 1; TFTime = iTime (기호 (), PERIOD_M15,1); } if ((TFTime! = iTime (Symbol (), PERIOD_H1,1)) (RangingS == 2)) {TrendPreFetch (); MaxpipfromEMA = MaxpipfromEMAH; 범위 지정 = 0; TFTime = iTime (기호 (), PERIOD_H1,1); }

alwagosliz
11-10-2021 15:15, 03:15 PM
최적화를하더라도, iCustom 함수는 EA를 정말로 느리게 만듭니다. 즉, 몇 가지 권장 사항이 있습니다. 마지막 순간에 그 내부를 계산하십시오. 이러한 if 문에서 RangePreFetch 및 TrendPreFetch를 호출하는 대신 PERIOD_H1 또는 PERIOD_M15로 마침표 변수를 설정하도록합니다. 그런 다음 인디 타임 프레임에 대한 기간을 사용하여 필요에 따라 내부를 계산하십시오. 모든 진드기에 대해 모든 내부를 계산하는 대신, 대부분의 진드기에 대해서만 두 가지 정도의 내부를 계산한다는 것을 알게 될 것입니다. 내부를 최적화하십시오. 일반적으로 맞춤 내부의 최적화를위한 여지가 많이 있습니다. 소스를 가지고 있다면 그것을 한 번 넘겨주세요.