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 ?
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);
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 ?