OverBought - OverSold explorer indicator "newbie" question

#1
Hi, For an exploration indicator for an oscillator, let's talk about RSI, I want to do something like this:

Code:
RSIOb   =   70
RSIOs   =   30

        [COLOR="Red"]RSIUt		=	RSI(14)		>	Ref(RSI(14),-1);
	RSIDt		=	RSI(14)		< 	Ref(RSI(14),-1);
	RSIBuy		=	RSI		<	RSIOs AND ARSIUt;
	RSISell		=	RSI		>	RSIOb AND ARSIDt;[/COLOR]

RSI_Status		=	WriteIf(RSIBuy,"-=BUY=-",
				WriteIf(RSI(14) > RSIOs,"OverSold",
				WriteIf(RSIUt,"Improving",
				WriteIf(RSIDt,"Declining",
				WriteIf(RSI < RSIOb,"OverBought",
				WriteIf(RSISell,"-=SELL=-",""))))));
RSI_Color		=	IIf(RSIBuy,Color_buy,
				IIf(RSI>ARSIOs,Color_bull,
				IIf(RSIUt,Color_bull1,
				IIf(RSIDt,Color_bear1,
				IIf(RSI<ARSIOb,Color_bear,
				IIf(RSISell,Color_sell,Color_null))))));

Filter = 1;

AddColumn		(RSI_Status,"RSI (14)",1,ColorWhite,RSI_Color);
The result I want to obtain on the explorer indicator is the following:
1) BUY: When the RSI(14) are below the RSIOs level AND the trend of the indicator are upwards regarding it's last position.

2) Sell: When the RSI(14) are above the RSIOb level AND the trend of the indicator are downwards regarding it's last postion.

3) Trend: When the indicator is between the OverBought and OverSold levels, only reads the trend lecture regarding it's last position.

... What is wrong with the logic I am applying as marded on the Red Code ? I am missing something ?
 

KelvinHand

Well-Known Member
#2
Hi, For an exploration indicator for an oscillator, let's talk about RSI, I want to do something like this:

The result I want to obtain on the explorer indicator is the following:
1) BUY: When the RSI(14) are below the RSIOs level AND the trend of the indicator are upwards regarding it's last position.

2) Sell: When the RSI(14) are above the RSIOb level AND the trend of the indicator are downwards regarding it's last postion.

3) Trend: When the indicator is between the OverBought and OverSold levels, only reads the trend lecture regarding it's last position.

... What is wrong with the logic I am applying as marded on the Red Code ? I am missing something ?
Give so much typo errors and not including the colors in the code. How you expect people to help you ?

Base on your logic:

1. RSIBuy : RSI(14) < RSIOs AND RSIUt;
Buy when RSI below 30 and the current RSI is slope up but still did not break above 30

2. RSISell : RSI(14) > RSIOb AND RSIDt;
Sell when RSI above 70 and the current RSI is slope down but still did break below 70

3. WriteIf(RSI(14) > RSIOs,"OverSold",
RSI > 30, how can be oversold ?

4. WriteIf(RSI(14) < RSIOb,"OverBought",
RSI < 70, how can be OverBought ?

5. If above logic is wrong. you are not able to do trend between 30 to 70


The following scripts rectified the errors but not rectified the logic.
Code:
Color_buy = colorGreen;
Color_bull = colorLime;
Color_bull1 = colorAqua;
Color_null = colorGrey40;
Color_bear = colorRed;
Color_bear1 = colorPink;
Color_sell = colorGold; 


RSIOb   =   70;
RSIOs   =   30;

  RSIUt		=	RSI(14)		>	Ref(RSI(14),-1);
	RSIDt		=	RSI(14)		< 	Ref(RSI(14),-1);
	RSIBuy		=	RSI(14)		<	RSIOs AND RSIUt;
	RSISell		=	RSI(14)		>	RSIOb AND RSIDt;

RSI_Status		=	WriteIf(RSIBuy,"-=BUY=-",
				WriteIf(RSI(14) > RSIOs,"OverSold",
				WriteIf(RSIUt,"Improving",
				WriteIf(RSIDt,"Declining",
				WriteIf(RSI(14) < RSIOb,"OverBought",
				WriteIf(RSISell,"-=SELL=-",""))))));
RSI_Color		=	IIf(RSIBuy,Color_buy,
				IIf(RSI(14)>RSIOs,Color_bull,
				IIf(RSIUt,Color_bull1,
				IIf(RSIDt,Color_bear1,
				IIf(RSI(14)<RSIOb,Color_bear,
				IIf(RSISell,Color_sell,Color_null))))));

Filter = 1;

AddTextColumn		(RSI_Status,"RSI (14)",1,colorWhite,RSI_Color);
 
Last edited:

Similar threads