NexusFi: Find Your Edge


Home Menu

 





RSI Optimizer


Discussion in EasyLanguage Programming

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




 
Search this Thread

RSI Optimizer

  #1 (permalink)
StockShark
Lund Sweden
 
Posts: 2 since May 2014
Thanks Given: 1
Thanks Received: 0

Hey Forum!

This will be my first post ever in a Stock Forum. I'm a beginner trader who has a long background of programming in Java, Vector Analysis and Finance in general - but I've just started out with TA and grown a big passion for Quantitative analysis and realised that it is what I would want to work with for the rest of my life.

Enough about me I'm sorry for posting such a beginner question. I'm very used to look for similiar answers on search engines, but since I've only been programming for two days in Power Language and I'm very stuck, I'll appreciate any help.

Problem Description: I'm trying to build a simple signal in MC which buys Stocks when RSI hits less than 30, and sells if it hits bigger than 70. Unfortunatley, I'm having a lot of difficulties understanding the arguments of the RSI() function in MC, and how would it know how much I would like to buy?

Code (please be gently with me):

 
Code
inputs:
	Price ( Close ),
	Length ( 200 ),
	OverSold ( 30 ),	
	OverBought ( 70 );
variables:
	var0 ( 0 );

	
// Set Conditions
var0 = RSI( Price,Length );

condition1 = CurrentBar > 1 and var0 crosses over OverSold;
condition2 = CurrentBar > 1 and var0 crosses over OverBought;


//Strategy

if condition1 then begin
	Buy ( "RSI_Optimizer" ) next bar at market;
end;

if condition2 then begin
	Sell ( "RSI_Optimizer" ) next bar at market;
end;

All the best,
/Shark

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - May 2024
Feedback and Announcements
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
25 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,435 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628


StockShark,

welcome to futures.io (formerly BMT). Your code uses "crosses over" for both thresholds, when in fact I guess you are looking for "crosses under OverSold". For specifying how much to buy/sell: This can either be done under the properties when you load the strategy to a chart or directly in the code like this.
 
Code
Buy ( "RSI_Optimizer" ) 100 shares next bar at market;
"Shares" is the same as "contracts", so you can use either one.

Regards,
ABCTG


StockShark View Post
Hey Forum!

This will be my first post ever in a Stock Forum. I'm a beginner trader who has a long background of programming in Java, Vector Analysis and Finance in general - but I've just started out with TA and grown a big passion for Quantitative analysis and realised that it is what I would want to work with for the rest of my life.

Enough about me I'm sorry for posting such a beginner question. I'm very used to look for similiar answers on search engines, but since I've only been programming for two days in Power Language and I'm very stuck, I'll appreciate any help.

Problem Description: I'm trying to build a simple signal in MC which buys Stocks when RSI hits less than 30, and sells if it hits bigger than 70. Unfortunatley, I'm having a lot of difficulties understanding the arguments of the RSI() function in MC, and how would it know how much I would like to buy?

Code (please be gently with me):

 
Code
inputs:
	Price ( Close ),
	Length ( 200 ),
	OverSold ( 30 ),	
	OverBought ( 70 );
variables:
	var0 ( 0 );

	
// Set Conditions
var0 = RSI( Price,Length );

condition1 = CurrentBar > 1 and var0 crosses over OverSold;
condition2 = CurrentBar > 1 and var0 crosses over OverBought;


//Strategy

if condition1 then begin
	Buy ( "RSI_Optimizer" ) next bar at market;
end;

if condition2 then begin
	Sell ( "RSI_Optimizer" ) next bar at market;
end;

All the best,
/Shark


Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on May 9, 2014


© 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