Your expression
ind2[0]= iCustom(NULL,0,indicator2,0,true,0);
is wrong
real expression
double iCustom( | string symbol, int timeframe, string name, ..., int mode, int shift) |
Hi Roger,
thanks for spotting the problem.
sorry for the wrong expression:
the real expression used are during posting this forum is
ind2[0]= iCustom(NULL,0,indicator2,0,0); //withoud the "true" extern variable defined.
So the problem still persisit.
Any one have encounter this problem before? or use similar or better method to test the custom indicator in Strategy tester?
Is there any exisitng article on this method?
This Post solve the problem on invalidate of custom indicator in the stragety tester.
Add custom indicator to the Strategy Tester Chart after "Start"
Is this the best way?
My doubt on iCustom() is still not solved:
1. When EA use iCustom(), do the custom indicator Init() trigger everytime the "iCustom()" called or it trigger only once at the adding time of EA to the Chart?
2. Is iCustom() shows same behaviour as it is when manually added to Live chart window?
Thanks in advance for helping to clarify the doubt.
Did you ever get an answer as to why your EA was pulling up a zero everytime when you tried to call on the iCustom? I'm having the same exact issue when referencing iCustom in my EA or even a simple script with an alert...I keep gettting a zero! Even though my custom indicator plots fine on the chart itself.
I would like to test the Custom indicator using Strategy Tester. Hence I create a simple EA to call the Custom Indicator using iCustom()
Problem: Custom indicator global variable seem do not record the previous assigned value when testing in Strategy Tester but this is not the case when manually attach to chart window.
EA Code:
The on test Custom Indicator Code:
-----------
test result
-----------
Custom Indicator shot from Strategy Tester
Custom indicator label showing "0" on Strategy Tester Chart window (when testing on progress).
Custom Indicator shot from Strategy Tester 2
Custom indicator label showing "1" on Strategy Tester Chart window (when Stop pressed).
Manual attach Custom Indicator to Chart Window
Custom Indicator showing "1" on live Chart window when custom indicator manually attached.
Suspect for problem:
1. what happen when EA called iCustom each time?
when tick arrive, iCustom() trigger, is the sequence of indicator evaluation start from Init()->Start() always?
or control go directly to Start() and the Init() only trigger once when the strategy tester started?
2. Is this problem caused only to UI Invalidate problem but the global variable value still take effect during run time on Strategy tester?
It seem like UI do not show correct result "1" but showing "0" instread during run time, but it shows the correct result "1" when Stop pressed.
Any one know why this happen?
Thanks for taking time to understand the problem. Please let me know if you need any further clarification.
Thanks.
It can happen if you define Ind as an integer array
ForexWatchman
I am having the same problem. I am calling iCustom from an Indicator and from an expert advisor and getting different results. I have inserted print statements and I know the parameters being passed are identical.
EA:
double haOpen = iCustom(NULL,prd,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,yy);
double haClose = iCustom(NULL,prd,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,yy);
Print(" Heiken EA tf=",tf," yy=",yy," prd=",prd," open=",haOpen," close=",haClose," ",MaMetod," ",MaPeriod," ",MaMetod2," ",MaPeriod2);
Indicator:
haOpen = iCustom(NULL,prd,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,2,yy) ;
haClose = iCustom(NULL,prd,"Heiken_Ashi_Smoothed",MaMetod,MaPeriod,MaMetod2,MaPeriod2,3,yy) ;
Alert(" Heiken indicator tf=",tf," prd=",prd," open=",haOpen," close=",haClose," ",MaMetod," ",MaPeriod," ",MaMetod2," ",MaPeriod2," yy=",yy);
This is very frustrating.
Larene
I figured it out. Here is my EA. I can view the direction on 4 time frames.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I would like to test the Custom indicator using Strategy Tester. Hence I create a simple EA to call the Custom Indicator using iCustom()
Problem: Custom indicator global variable seem do not record the previous assigned value when testing in Strategy Tester but this is not the case when manually attach to chart window.
EA Code:
The on test Custom Indicator Code:
-----------
test result
-----------
Custom Indicator shot from Strategy Tester
Custom indicator label showing "0" on Strategy Tester Chart window (when testing on progress).
Custom Indicator shot from Strategy Tester 2
Custom indicator label showing "1" on Strategy Tester Chart window (when Stop pressed).
Manual attach Custom Indicator to Chart Window
Custom Indicator showing "1" on live Chart window when custom indicator manually attached.
Suspect for problem:
1. what happen when EA called iCustom each time?
when tick arrive, iCustom() trigger, is the sequence of indicator evaluation start from Init()->Start() always?
or control go directly to Start() and the Init() only trigger once when the strategy tester started?
2. Is this problem caused only to UI Invalidate problem but the global variable value still take effect during run time on Strategy tester?
It seem like UI do not show correct result "1" but showing "0" instread during run time, but it shows the correct result "1" when Stop pressed.
Any one know why this happen?
Thanks for taking time to understand the problem. Please let me know if you need any further clarification.
Thanks.