How indicator run from iCustom know which period to use?

 

Hi, when i use indicator on the chart all is fine, but when I use it from iCustom then is use the default for him period of time, is this anyhwo possible to change it? i mean how can I manipulate inside the indicator which time period is used for arrays like Buy[] or Sel[]. To be honest, value are diffrent only on test advisor.

 
koskow:

Hi, when i use indicator on the chart all is fine, but when I use it from iCustom then is use the default for him period of time, is this anyhwo possible to change it? i mean how can I manipulate inside the indicator which time period is used for arrays like Buy[] or Sel[]. To be honest, value are diffrent only on test advisor.


The second parameter in an iCustom() call is timeframe
 
The SECOND argument to iCustom is the timeframe.
 
Dang it, Raptor. We keep posting the same message at the same time. :)
 
WHRoeder:
Dang it, Raptor. We keep posting the same message at the same time. :)
:-)  great minds . . etc  ;-)
 
RaptorUK:
:-)  great minds . . etc  ;-)


WHRoeder:
Dang it, Raptor. We keep posting the same message at the same time. :)

Thanks, i checked now, and the problem is differnt, i will try to explain:

I have some simple indicator, when i attachat it to the chart it gives me the same results for each time frame.

The problem is when i run this indicator in strategy tester, when i simply attache to the chart , it gives different values for different time frames(i mean the time which i select when I run the strategy tester), why it can be like this? And I mean , simply attach to the screen not by using iCustom.

 

I see this when i start the testing, i don't know if the values are te same when tester runs longer, (then same on differnte time frames). 

 
What is the line of code that calls your indicator?
 
Elroch:
What is the line of code that calls your indicator?

read please what i wrote above, I am attaching the indicator to the chart, not by code, and in normla view indicator is the same on each time frames (H1,H4..) but when I use advisor test then depend on period frame i chose for testing, the value from indicator for each time frame is differnt. how is this possible?
 
koskow:


Thanks, i checked now, and the problem is differnt, i will try to explain:

I have some simple indicator, when i attachat it to the chart it gives me the same results for each time frame.

The problem is when i run this indicator in strategy tester, when i simply attache to the chart , it gives different values for different time frames(i mean the time which i select when I run the strategy tester), why it can be like this? And I mean , simply attach to the screen not by using iCustom.

 

I see this when i start the testing, i don't know if the values are te same when tester runs longer, (then same on differnte time frames). 

The Strategy Tester is for testing strategies . . .  EAs,  some Indicators will not work correctly when attached to a Strategy Tester chart . . .
 
RaptorUK:
The Strategy Tester is for testing strategies . . .  EAs,  some Indicators will not work correctly when attached to a Strategy Tester chart . . .


Elroch:
What is the line of code that calls your indicator?


Hi, finally i think i see what is reall problem:

when I use Strategy Tester and and run some indicator using iCusotm, i got proper results, but on the same chart (in strategy tester when i attached this indicator to the chart) is use the whole data, like from the future, that it the problem and from this is the difference, so seems that this indicator in Strategy Tester works perfectly couse he know what will be next.... i have no idea how this is possible. Would you help me if i post the code here? 

 
koskow:


Hi, finally i think i see what is reall problem:

when I use Strategy Tester and and run some indicator using iCusotm, i got proper results, but on the same chart (in strategy tester when i attached this indicator to the chart) is use the whole data, like from the future, that it the problem and from this is the difference, so seems that this indicator in Strategy Tester works perfectly couse he know what will be next.... i have no idea how this is possible. Would you help me if i post the code here? 

Let me give you an example of why some Indicators do not work correctly in the Strategy Tester . . . .  if you place an Indicator onto a Strategy Tester chart and that Indicator uses Bid it will be the current,  1st Feb 2013,  Bid price that it uses . . . not the Bid price shown on the Strategy Tester chart,  it's very easy to address this issue, instead of using Bid use Close[0]  instead.

Are there other issues like this when trying to use Indicators on Strategy Tester generated chart ?  Yes I'm sure there are. 

Do I know what all these issues are and how to fix them ?  No,  I have come across some,  you should determine what the issues are with your own Indicator and address then. 

Reason: