View Single Post
  #106 (permalink)  
Old 02-14-2008, 01:33 PM
meda meda is offline
Junior Member
 
Join Date: Aug 2006
Posts: 6
meda is on a distinguished road
AC/Stoch zero line

Quote:
Originally Posted by pegasus200 View Post
Azmel,

Regarding the Stoch crossing at 0 of AC, you can do the following:

Calculate the maximum and minimum values of the AC indicator for a determined number of bars (this number of bars can be an external variable parameter). Now having the min and max value, you can then calculate the % of shift you have on the indicator window by doing:

x%=(100*Max)/(Max+Min)

This tells you the space % used by the the positive AC value in the indicator window. Now take 50% - x% and this gives you by how much you must move the stoch crossing value. It simulates the visual reading ! If the x% value is below 50, the stoch cross line will be above 50% and if the x% value is above 50, the stoch cross line will be below 50% which is what we see in visual mode !! The only problem is to have the good number of bars i.e. what is the zooming of the chart that is optimal for a good stoch signal. Maybe an optimization in the strategy tester could help

Hope it is clear and maybe you can code this also in the new version, just to see if it helps with the results.

Cheers!

pegasus,
am i right? Sorry for my English .

ACspace = vertical space for AC in the indicator window
we have (maybe) 62 bars from ozfx.tpl after F11

algorithm:

if ACmin<0, ACmax>0 then ACspace=abs(ACmin)+ACmax
if ACmin<0, ACmax<0 then ACspace=abs(ACmax)-abs(ACmin)
if ACmin>0, ACmax>0 then ACspace=ACmax-ACmin

x% = 100*abs(ACmax)/ACspace

stochzero = 100% - x%

if stoch>stochzero then BUY
if stoch<stochzero then SELL

Is it better than "stochzero"=50? Can you, Azmel, code it?

thx, meda
Reply With Quote