[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Help Converting TradeStation code to AFL



PureBytes Links

Trading Reference Links

I am trying to convert TradeStation code to AFl.  I am a beginner in 
essay language.  If someone familiar with trade station code can 
explain how the code below works I think I can figure out how to do 
the conversion.  The code below is a function called by another 
indicator.  I am confused by what appears to be variables and 
constants and how they are handled. Any explanation would be hugely 
helpful and appreciated. 

[LegacyColorValue = true]; 

{ TSMStDevConfidence : Standard deviation confidence level (in 
percent)


  Returns confidence level, e.g., if stdev = 2.0 then confidence = 
95.44,
  including both ends of the curve. To find confidence of one end of 
the
  distribution, divide result by 2. }

	inputs: price(numericseries), length(numericsimple);
	vars:	n(0), pi(3.1415926), e(2.7182818), exp(0), sd(0), diff
(0), diff2(0),
			const(0);

	n = length;
	if currentbar < length then n = currentbar;
	diff = price - average(price,n);
	diff2 = power(diff,2);
	sd = squareroot(average(diff2,n));

	exp = sd*sd / 2;
	const =  1.00 / squareroot(2*pi);
	TSMStDevConfidence =100 -  100 * const  * power(e,-exp);



------------------------------------

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html

*********************************
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/