Welcome! Log In Create A New Profile

Get Earnings and Seasonal Trends - Subscribe Today!

Advanced

StochasticSlow - Signals in the WATCH LIST ( Help )

Posted by optiontrader101 
StochasticSlow - Signals in the WATCH LIST ( Help )
May 03, 2014 02:50AM
Good afternoon ,

Any one can help in coding this script "with the same values" to be in the Watch list as a separated column sell / buy signal or red / green.

for Example :








# StochasticSlow - Signals
# Apr/11/2014
# jaimepinto@rogers.com

declare upper;

input over_bought = 80;
input over_sold = 30;
input KPeriod = 2;
input DPeriod = 2;
input priceH = close;
input priceL = close;
input priceC = close;
input smoothingType = {Default EMA};

def SlowD = reference StochasticFull(over_bought,over_sold,KPeriod,DPeriod,priceH,priceL,priceC,3,smoothingType).FullD;

plot buy = if SlowD crosses above over_sold then low else Double.Nan;
buy.SetPaintingStrategy( PaintingStrategy.ARROW_UP );
buy.SetDefaultColor( Color.MAGENTA );

plot sell = if SlowD crosses below over_bought then high else Double.Nan;
sell.SetPaintingStrategy( PaintingStrategy.ARROW_DOWN );
sell.SetDefaultColor( Color.CYAN );
Re: StochasticSlow - Signals in the WATCH LIST ( Help )
May 03, 2014 05:08AM
try this

def SlowD = StochasticFull(80, 30, 2, 2, close, close, close, 3, "EMA" ).FullD;
def buy = SlowD crosses above 80;
def sell = SlowD crosses below 30;
def null = !buy and !sell;
AddLabel(buy, "Buy" );
AddLabel(sell, "Sell" );
AddLabel(null, "." );
AssignBackgroundColor(if buy then Color.DARK_GREEN else if sell then Color.DARK_RED else Color.CURRENT);



Edited 1 time(s). Last edit at 05/03/2014 09:22AM by robert.
Re: StochasticSlow - Signals in the WATCH LIST ( Help )
May 03, 2014 11:53AM
thank you very much Robert .

Can you make this code to give the signal for only the last candle ?

to make it clear for you , see the chart and the (Watch List) that I tried to did it to be a confirmation for the Divergence :

here, the SlowStochastic for the last candle is ( BUY ) , Divergence is ( +ve) " Stock may go up"




and here , SlowStochastic for the last candle is ( SELL ) , Divergence is ( -ve) "Stock may go down"

Re: StochasticSlow - Signals in the WATCH LIST ( Help )
May 03, 2014 12:37PM
I'm sorry, but I do not understand what you are asking for this time.
Re: StochasticSlow - Signals in the WATCH LIST ( Help )
May 04, 2014 05:33PM
thanks Robert and sorry for disturbance , I got the code for the StochasticSlow that will show a signal for only the last day :




# StochasticSlow - Signals

# Apr/11/2014

# jaimepinto@rogers.com

# May 4th 2014 jBoily, Modified script for Column



declare upper;



input over_bought = 80;

input over_sold = 30;

input KPeriod = 2;

input DPeriod = 2;

input priceH = close;

input priceL = close;

input priceC = close;

input smoothingType = {Default EMA};



def SlowD = reference StochasticFull(over_bought,over_sold,KPeriod,DPeriod,priceH,priceL,priceC,3,smoothingType).FullD;



def buy = SlowD crosses above over_sold;

def sell = SlowD crosses below over_bought;

plot BuySell = Buy or Sell;


BuySell.SetDefaultColor( Color.Gray );

AssignBackgroundColor( If Buy then Color.Green else if sell then color.Red else color.Black);


Addlabel(Buy,"Buy",color.Black);

Addlabel(Sell,"Sell",color.Cyan);

Addlabel(!BuySell," ",color.Black);

Sorry, only registered users may post in this forum.

Click here to login