ä½åãªã«ã¼ããªã®ãï¼
Travis 2010/11/12 18:47
ãã¤ããä¸è©±ã«ãªã£ã¦ãã¾ãã
ã¤ã³ã¸ã±ã¼ã¿ã®åºæ¬çãªãã¨ã«é¢ãã質åã§ãã
å¤ãã®ã¤ã³ã¸ã±ã¼ã¿ã®starté¢æ°ã§ã¯ä¸è¨ã³ã¼ãã£ã³ã°ã«ãªã£ã¦ãã¾ããint counted_bars=IndicatorCounted();
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(int i=0; iæ®éã®ã¤ã³ã¸ã±ã¼ã¿ã§ã¯ã«ã¬ã³ããã¼ã®å¦çã ãã§è¯ãã¨æãã®ã§ããï¼æ¬åã®ãã¼ã®å¦çãããªããã°ãããªãçç±ãããã®ã§ããããï¼
éãã¤ã³ã¸ã±ã¼ã¿ã®å ´åå¦çéãååã«ãªãã®ã§å¹æãããã¨æãã®ã§ããï¼
å¤ãã®ã¤ã³ã¸ã±ã¼ã¿ããããªã£ã¦ããçµç·¯ã¯ãããããããã°ã©ããMT4ä»å±ã®ã¤ã³ã¸ã±ã¼ã¿ããã³ãã¬ã¼ããçä¼¼ãããã ã¨æãã¾ãã
âMT4ä»å±ã®ãµã³ãã«ã³ã¼ãã§ããåãã«ã¼ãå¦çã«ãªã£ã¦ãã¦ããããã recounted ãããã¨ã³ã¡ã³ãã¾ã§ä»ãã¦ãã¾ãã
æ¬æ¥ã®MQL4ã§ã®å®ç¾©ã¯ã
Bars | ãã£ã¼ãä¸ã®ãã¼ã®æ¬æ° |
IndicatorCounted() | æå¾ã«å¼ã°ãã¦ããå¤åã®ãªããã¼ã®æ¬æ° |
ãªã®ã§ã limit = Bars - IndicatorCounted() æ¬ã ãåè¨ç®ããã°ããã¯ãã§ãã
âå®éã«ã«ã¼ãæ°ãå¤ãã¦ã¤ã³ã¸ã±ã¼ã¿ãä½ã£ã¦æ¯è¼ãã¦ããã©ã¡ããåã表示ã«ãªãã¾ãã
ããã§ãIndicatorCounted()ã®ヘルプãèªãã¨ã
Note: The latest bar is not considered to be calculated and, in the most cases, it is necessary to recalculate only this bar. However, there occur some boundary cases where custom indicator is called from the expert at the first tick of the new bar. It is possible that the last tick of the previous bar had not been processed (because the last-but-one tick was being processed when this last tick came), the custom indicator was not called and it was not calculated because of this. To avoid indicator calculation errors in such situations, the IndicatorCounted() function returns the count of bars minus one.
é»è²ã®é¨åã¯ãTravisããã®èããã¨ããã§ãããEAãã iCustom ã§å¼ã³åºãå ´åã赤åé¨åã®æåãåé¡ã¨ãªãã®ã§
//---- the last counted bar will be recounted
if(counted_bars>0) counted_bars--;
âãã®ä¸è¡ãæ¢ãã¦å ããããã®ããªã¨æãã¾ãã..ã
ã¨ããããBuild 226 㧠EA ãã iCustom çµç±ã§ã¤ã³ã¸ã±ã¼ã¿ãå¼ã³åºããIndicatorCounted() ã®æ°å¤ãè¨é²ããã¨ããã
ææ°ã®ãã¼ãã§ããæåã®Tick ã§ã¯ãBars - IndicatorCounted() ã 2 ã¨ãªã£ã¦ããã®ã§ãææ°ã®ãã¼ã¨ããã®åã®ãã¼ãåè¨ç®ããã¾ãã
ãããªããã¦ã¼ã¶ãæå³çã« counted_bars--; ããå¿
è¦ã¯ãªããªãã¾ãã
ç¶æ³è¨¼æ ããæ¨çããã¨ã大æ㯠counted_bars--; ãã¦1æ¬ä½åã«è¨ç®ããªãã¨EAãæ£ããåããªãã£ãã®ã ãã©ãç¾å¨ã§ã¯ IndicatorCounted() ã®ä»æ§ãæ¹è¯ããã¦ä¸è¦ã«ãªã£ãã®ã§ã¯ãªããã¨...å人çã«ã¯æãã¾ããã
è±æã®ãã«ãã¯æå¾ãå¾®å¦ã«æå³ä¸æãªã®ã§ãã以ä¸ã¯åããã¾ãããã^^ï¼