How to plot the previous 20 period RSI(9) high overlay on current RSI(9)? - AmiBroker | futures io social day trading
futures io futures trading


How to plot the previous 20 period RSI(9) high overlay on current RSI(9)?
Updated: Views / Replies:674 / 5
Created: by kaysonchan Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

How to plot the previous 20 period RSI(9) high overlay on current RSI(9)?

  #1 (permalink)
Trading Apprentice
Singapore
 
Futures Experience: Beginner
Platform: Amibroker
Favorite Futures: Equities
 
Posts: 5 since Feb 2016
Thanks: 2 given, 0 received

How to plot the previous 20 period RSI(9) high overlay on current RSI(9)?

Hello guys,

i am beginner to Amibroker and will appreciate much if you can teach me how to write the code for this conditions:

How to plot the previous 20 period Highest RSI(9) high overlay on current RSI(9)?


Thank you!

Reply With Quote
 
  #2 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 33 received

See https://www.amibroker.com/guide/afl/hhv.html

 
Code
// RSI and HHV(RSI) example
// by prouser

SetChartOptions( 0, chartShowArrows | chartShowDates | chartWrapTitle, gridFlags = 0, ymax = 0, xmax = 0, blankmargin = 0 );

periods = Param( "RSI Periods", 15, 1, 200, 1 );
HHVperiods = Param( "HHV Periods", 20, 1, 200, 1 );
RSIcolor = ParamColor( "RSI Color", colorCycle );

myRSI = RSI( periods );
HHV_RSI = HHV( myRSI, HHVperiods );

GraphLabelDecimals = 2;

Plot( myRSI, "RSI", RSIcolor, ParamStyle( "RSI Style" ) | styleNoTitle, Null, Null, 0, 1 );
Plot( HHV_RSI, "HHV RSI", colorDarkGreen, ParamStyle( "HHV Style" ) | styleNoTitle, Null, Null, 0, 1 );

PlotGrid( 30, colorBrightGreen, pattern = 0, width = 2, label = True );
PlotGrid( 50, colorGrey50, pattern, width, label );
PlotGrid( 70, colorRed, pattern, width, label );

_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} - " +
                       EncodeColor( RSIcolor ) + "RSI(%g): %g  " +
                       EncodeColor( colorDarkGreen ) + "HHV(RSI(%g), %g): %g " +
                       EncodeColor( -1 ) + "{{VALUES}}",
                       periods, myRSI, periods, hhvperiods, HHV_RSI ) );

Reply With Quote
The following 2 users say Thank You to prouser for this post:
 
  #3 (permalink)
Trading Apprentice
Singapore
 
Futures Experience: Beginner
Platform: Amibroker
Favorite Futures: Equities
 
Posts: 5 since Feb 2016
Thanks: 2 given, 0 received


Thank you so much Prouser, this is what i am trying to plot. =)
Will let you know if i manage to get any meaningful results from it.

Have a great week!

Reply With Quote
 
  #4 (permalink)
Trading Apprentice
Singapore
 
Futures Experience: Beginner
Platform: Amibroker
Favorite Futures: Equities
 
Posts: 5 since Feb 2016
Thanks: 2 given, 0 received

Hi, so sorry to bother again.

I am trying to issue a buy signal when the RSI(x) becomes the HHV_RSI, plus only when RSI is more than 50 but unable to get a accurate buy signal from my backtest. The buy signals are random not following the criteria i issue.
Here is the code i used. Is there any mistake here?

BuySignal1 = Cross(myRSI, HHV_RSI); // myRSI >= HHV_RSI;
BuySignal2 = myRSI > 50;

// buy on the next bar
Buy = Ref( BuySignal1 AND BuySignal2, -1);


TY

Reply With Quote
 
  #5 (permalink)
Membership Temporarily Revoked
Zurich/Switzerland
 
Futures Experience: Advanced
Platform: -
Favorite Futures: -
 
Posts: 79 since Oct 2014
Thanks: 0 given, 33 received

If you use Cross() then you expect one var to have a higher/lower value than the second var in order to return true.
So in this case you expect RSI of "current" bar having a higher value than its own highest value at "current" bar. If a var crosses above its own "current" highest value then it would be expected to be higher than that. But it is logically impossible that this condition will ever return true. Can you follow the logic?

That's why using previous highest value as second argument would make more sense.

 
Code
BuySignal1 = Cross( myRSI, Ref(HHV_RSI, -1) );

Reply With Quote
The following user says Thank You to prouser for this post:
 
  #6 (permalink)
Trading Apprentice
Singapore
 
Futures Experience: Beginner
Platform: Amibroker
Favorite Futures: Equities
 
Posts: 5 since Feb 2016
Thanks: 2 given, 0 received

Thanks prouser. I understand the logic now. Basically the two period moves systematically so it doesnt make sense for it to cross over its own high. It makes more sense with a 1 bar delay like the one in your code.

Thanks for clearing my doubts again=)

Reply With Quote

Reply



futures io > > > > How to plot the previous 20 period RSI(9) high overlay on current RSI(9)?

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
The different between RSI and CCI liorzuk Platforms and Indicators 7 January 28th, 2015 01:31 PM
Plot rectangles on RSI indi fttrdr NinjaTrader Programming 6 January 7th, 2012 05:23 PM
How to overlay bollinger and RSI on the same panel in Ninja 7? bingo17 NinjaTrader 10 October 6th, 2011 05:27 PM
RSI value for a previous period arjfca EasyLanguage Programming 4 November 9th, 2010 02:29 PM
Plot RSI intrabar extremes jtrade The Elite Circle 13 April 12th, 2010 02:25 PM


All times are GMT -4. The time now is 03:14 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-14 in 0.09 seconds with 19 queries on phoenix via your IP 54.145.16.43