Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
Hi VT
Without your formulas it’s impossible to exactly replicate the problem you have without going to some trouble. Therefore what I suggest you do is copy the exploration code and create a new indicator, then use the indicator to successively plot and check all variable results on one or two of the securities returning incorrect values. The only reason for an exploration to return different values from an indicator with the same code would be if the exploration was not loading sufficient bars of data. Exponential moving averages are intolerant of too little data, but so are ValueWhen(), BarsSince(), HighestSince() and a number of other functions not requiring a Periods parameter. Any function using an Nth parameter needs the user to force-load sufficient bars. Using the Minimum Records option is asking for trouble.
It’s a good idea when using a ValueWhen() function, especially in an exploration, to create an “initialised” signal to be ORed with the Expression parameter. Ideally an “I” bar spikes TRUE for one bar once all user variables are valid. Without an “I” bar being included in the Expression parameter of ValueWhen() there’s a definite possibility that the primary condition will not eventuate and the function will instead return a rather useless N/A. Of course the “I” bar alone can generate an inappropriate result too, but there are ways to separate those from legitimate results.
Here are the steps that you need to cycle through with the indicator version of the exploration. If none of these show up anything odd then double check the bars you’re loading for the exploration. When the same number of bars is used for both exploration and indicator you WILL get the same result. The reason for testing by using an indicator is that you get to see what’s happening on EVERY bar, not just the last bar. A wrong result on the last bar (as reported by an exploration) is usually caused by something unexpected happening prior to the last bar. An indicator is much easier to troubleshoot if this is the situation you have.
Hope this helps.
Roy
a:=FmlVar("(C) StatsB&RSI Test","BUYRESULT"); b:= FmlVar("(C) StatsB&RSI Test","SHORTRESULT"); x:= BarsSince(a)=1 ; x;y:= BarsSince(b)=1 ; BuyPrice:= ValueWhen(1,x,O); ShortPrice:= ValueWhen(1,y,O);
a:=FmlVar("(C) StatsB&RSI Test","BUYRESULT"); b:= FmlVar("(C) StatsB&RSI Test","SHORTRESULT"); x:= BarsSince(a)=1 ; y:= BarsSince(b)=1 ; y;BuyPrice:= ValueWhen(1,x,O); ShortPrice:= ValueWhen(1,y,O);
a:=FmlVar("(C) StatsB&RSI Test","BUYRESULT"); b:= FmlVar("(C) StatsB&RSI Test","SHORTRESULT"); x:= BarsSince(a)=1 ; y:= BarsSince(b)=1 ; BuyPrice:= ValueWhen(1,x,O); BuyPrice;ShortPrice:= ValueWhen(1,y,O);
a:=FmlVar("(C) StatsB&RSI Test","BUYRESULT"); b:= FmlVar("(C) StatsB&RSI Test","SHORTRESULT"); x:= BarsSince(a)=1 ; y:= BarsSince(b)=1 ; BuyPrice:= ValueWhen(1,x,O); ShortPrice:= ValueWhen(1,y,O); ShortPrice;