NexusFi: Find Your Edge


Home Menu

 





RSI Cumulative Easy Language code


Discussion in TradeStation

Updated
    1. trending_up 3,994 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

RSI Cumulative Easy Language code

  #1 (permalink)
vanzolini
Sao Paulo, Sao Paulo/Brazil
 
Posts: 11 since Sep 2015
Thanks Given: 10
Thanks Received: 1

Hi,

Can someone help me write a code for a Larry Connors system that adds a series of daily RSIs?

The code I am looking for would allow me to test a cumulative RSI (Close, 2) for x days (x from 1 to 5, for instance)

What I am doing is writing the lengthy code, like this one below, and adding one day at a time ...

RSI_Cumulative = RSI(Close, 2) + RSI(Close[1], 2) + etc

Thanks,

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Online prop firm The Funded Trader (TFT) going under?
Traders Hideout
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
ZombieSqueeze
Platforms and Indicators
Are there any eval firms that allow you to sink to your …
Traders Hideout
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
43 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #2 (permalink)
 
martingjesus's Avatar
 martingjesus 
Madrid Spain
 
Experience: Master
Platform: Multicharts, Tradestation
Broker: Tradestation, InteractiveBrokers
Trading: Stocks
Posts: 15 since Sep 2015
Thanks Given: 10
Thanks Received: 5

Hi,

RSI_Cumulative=0

For i=1 to x begin
RSI_Cumulative = RSI_Cumulative + RSI(Close[i-1],2)
End

Follow me on Twitter Reply With Quote
Thanked by:
  #3 (permalink)
vanzolini
Sao Paulo, Sao Paulo/Brazil
 
Posts: 11 since Sep 2015
Thanks Given: 10
Thanks Received: 1


Thanks for your reply
I tried to put the piece of code in my formula but it is still not working
Here is the full code I am writing
Can you help me spot my mistake and ways to improve it?
Thanks,

Inputs:
RSI_Days (5),
OVSold (40),
OVBought (160);

Vars:
BullMarket (False),
RSI_Cumulative (0);

BullMarket = Close > Average (Close, 200);

RSI_Cumulative = RSI (Close, 2);

For i=2 to RSI_Days begin
RSI_Cumulative = RSI_Cumulative + RSI(Close[i-1],2)
End ;

If BullMarket and RSI_Cumulative < OVSold then buy next bar at market;

If (BullMarket = False) and RSI_Cumulative > OVBought then sellshort next bar at market;

If Marketposition = 1 then Begin
If RSI (Close, 2 ) > 65 then sell next bar at market;
end;

If Marketposition = -1 then Begin
If RSI (Close, 2 ) < 20 then buytocover next bar at market;
end;

Setstoploss (StopL);

Reply With Quote
  #4 (permalink)
 
martingjesus's Avatar
 martingjesus 
Madrid Spain
 
Experience: Master
Platform: Multicharts, Tradestation
Broker: Tradestation, InteractiveBrokers
Trading: Stocks
Posts: 15 since Sep 2015
Thanks Given: 10
Thanks Received: 5

Hi,

You have to declare i, in vars:

Vars:

i(1);

Also if you want to consider the last bar you should initialize it for i=1. That way you would include RSI(Close[0],2), the last bar calculation.

Follow me on Twitter Reply With Quote
  #5 (permalink)
vanzolini
Sao Paulo, Sao Paulo/Brazil
 
Posts: 11 since Sep 2015
Thanks Given: 10
Thanks Received: 1

Thanks

Reply With Quote
  #6 (permalink)
profitsnow
Medellin /Colombia
 
Posts: 2 since Dec 2015
Thanks Given: 1
Thanks Received: 0

Hi,

have anyone backtest a strategy based on this RSI before?

Reply With Quote




Last Updated on December 18, 2015


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts