PureBytes Links
Trading Reference Links
|
Using the RSI coded as basis, I tried to create an indicator that would plot on the price chart a pricevalue-for-next-bar that would cause the RSI(n) to equal 70. So I would know one day in advance at which price (in this case, closing price) I could consider my position as being overbought.
My algebric knowledge seems insufficient to pull out the right AFL code from the below RSI function (provided by Tomasz in the past and which gives identical result to the built in RSI:
function BuiltInRSIEquivalent( period )
{
P = N = 0;
result = Null;
for( i = 1; i < BarCount; i++ )
{
diff = C[ i ] - C[ i - 1 ];
W = S = 0;
if( diff > 0 ) W = diff;
if( diff < 0 ) S = -diff;
P = ( ( period -1 ) * P + W ) / period;
N = ( ( period -1 ) * N + S ) / period;
if( i >= period )
result[ i ] = 100 * P / ( P + N );
}
return result;
}
Plot( BuiltInRSIEquivalent( 14 ), "RSI 1", colorRed );
Plot( RSI( 14 ), "RSI 2", colorBlue );
Any help appreciated - this indicator would allow one to exit MOC by adding a condition to your order: exit at close if price > x.
Carl
------------------------------------
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com
TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
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:
amibroker-digest@xxxxxxxxxxxxxxx
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/
|