I´m a newbee to Easylanguage coming from AB, and I’m not a professional coder. My question is fairly simple.
I have 10 possible entries in one day. I want to rank then by RSI, to use 3 of them. I used PortfolioEntriesPriority=(100-RISI); and it didn’t work.
Is it strings the way to go?
Is there any example of this kind of code?
Thanks
Daniel Carvalho
How to rank stocks?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: How to rank stocks?
Hello Daniel,I´m a newbee to Easylanguage coming from AB, and I’m not a professional coder. My question is fairly simple.
I have 10 possible entries in one day. I want to rank then by RSI, to use 3 of them. I used PortfolioEntriesPriority=(100-RISI); and it didn’t work.
Is it strings the way to go?
Is there any example of this kind of code?
Thanks
Daniel Carvalho
Are you going to use this study in Portfolio Backtester or MultiCharts?
If it is Portfolio Backtester then do you need to limit each instrument to 3 trades or the entire porfolio of instruments?
Re: How to rank stocks?
Henry, I will use it in the portfolio backtester. The portfolio has 40 instruments, from those 10 will show and entry point in a given day. I need to choose 3 stocks (from this poll) based on the smallest RSI.
thanks
Daniel
thanks
Daniel
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: How to rank stocks?
Henry Thanks for your answer,
If I use close it works perfectly well, but if I use the RSI value it doesn’t.
inputs: Price( Close ), Length( 14 ), OverSold( 20 ) ;
variables: MyRSI( 0 ) ;
MyRSI = RSI( Price, Length ) ;
condition1 = Currentbar > 1 and MyRSI < OverSold ;
if condition1 then
Buy ( " MyRSI " ) This bar on Close;
Sell next bar at open; {just one idea to think about later}
PortfolioEntriesPriority=(100- MyRSI);
I guess MyRSI should be an array so the program “see” the RSI value for the corresponding stock. But I’m thinking as in AB. I extensively googled this question but couldn’t find any simple function to retrieve one stock selected by whatever criteria I want in easylanguage.
If I use close it works perfectly well, but if I use the RSI value it doesn’t.
inputs: Price( Close ), Length( 14 ), OverSold( 20 ) ;
variables: MyRSI( 0 ) ;
MyRSI = RSI( Price, Length ) ;
condition1 = Currentbar > 1 and MyRSI < OverSold ;
if condition1 then
Buy ( " MyRSI " ) This bar on Close;
Sell next bar at open; {just one idea to think about later}
PortfolioEntriesPriority=(100- MyRSI);
I guess MyRSI should be an array so the program “see” the RSI value for the corresponding stock. But I’m thinking as in AB. I extensively googled this question but couldn’t find any simple function to retrieve one stock selected by whatever criteria I want in easylanguage.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: How to rank stocks?
Hello Dan122,
We ran some tests in our environment and the code you have provided works ok.
Please have a look at the attached screenshot. Make sure you have Trade size set to "100% of Equity" in the strategy properties.
We ran some tests in our environment and the code you have provided works ok.
Please have a look at the attached screenshot. Make sure you have Trade size set to "100% of Equity" in the strategy properties.
- Attachments
-
- PortfolioPrioity.png
- (175.68 KiB) Downloaded 362 times