NexusFi: Find Your Edge


Home Menu

 





RSI Cumulative Easy Language code


Discussion in TradeStation

Updated
    1. trending_up 4,002 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?
MC PL editor upgrade
MultiCharts
Quant vue
Trading Reviews and Vendors
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
70 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Bigger Wins or Fewer Losses?
24 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
The Program
20 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