NexusFi: Find Your Edge


Home Menu

 





RSI Optimizer


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,375 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?
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
Cheap historycal L1 data for stocks
Stocks and ETFs
What broker to use for trading palladium futures
Commodities
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629


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