logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
mariyaaj000nas  
#1 Posted : Wednesday, July 24, 2024 9:23:51 AM(UTC)
mariyaaj000nas

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 7/9/2024(UTC)
Posts: 2
Location: Loss Angles

Hi everyone,

I am relatively new to MetaStock and trying to create a custom indicator for my trading strategy,. I want to design an indicator that combines moving averages with RSI to give buy/sell signals. 

Specifically, I’d like the indicator to trigger a buy signal when the short--term moving average crosses above the long-term moving average,, and the RSI is above 30... Conversely, a sell signal should be triggered when the short--term moving average crosses below the long-term moving average and the RSI is below 70.

Can anyone guide me through the steps to set this up: ?? Any sample code or tips would be greatly appreciated!

Thanks in advance!

Maria

MS Support  
#2 Posted : Thursday, July 25, 2024 4:46:22 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,960

Thanks: 92 times
Was thanked: 155 time(s) in 150 post(s)
Originally Posted by: mariyaaj000nas Go to Quoted Post

Hi everyone,

I am relatively new to MetaStock and trying to create a custom indicator for my trading strategy,. I want to design an indicator that combines moving averages with RSI to give buy/sell signals. 

Specifically, I’d like the indicator to trigger a buy signal when the short--term moving average crosses above the long-term moving average,, and the RSI is above 30... Conversely, a sell signal should be triggered when the short--term moving average crosses below the long-term moving average and the RSI is below 70.

Can anyone guide me through the steps to set this up: ?? Any sample code or tips would be greatly appreciated!

Thanks in advance!

Maria

Depending on how you want the indicator structured, you could write this in a variety of ways. You could also write this as an expert advisor to generate Buy and Sell graphical signals on a chart. As an Indicator, you could write the formula to provide a +1 for a Buy and a -1 for a Sell.

This is just a sample using Exponential Moving Averages and variables at the beginning that can be modified as desired:

Code:
STMA:=20;
LTMA:=50;
RSIPER:=14;
Buy:=Cross(Mov(C,STMA,E),Mov(C,LTMA,E)) AND RSI(RSIPER) > 30;
Sell:=Cross(Mov(C,LTMA,E),Mov(C,STMA,E)) AND RSI(RSIPER) < 70;
If(Buy,1,If(Sell,-1,0))

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.