NexusFi: Find Your Edge


Home Menu

 





StochasticSlow <--- need help to modify it


Discussion in ThinkOrSwim

Updated
      Top Posters
    1. looks_one rmejia with 2 posts (2 thanks)
    2. looks_two kingfish88 with 1 posts (0 thanks)
    3. looks_3 khalid alshalan with 1 posts (0 thanks)
    4. looks_4 Martzee with 1 posts (0 thanks)
    1. trending_up 8,254 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 2 attachments




 
Search this Thread

StochasticSlow <--- need help to modify it

  #1 (permalink)
khalid alshalan
Riyadh SaudiArabia
 
Posts: 7 since Mar 2014
Thanks Given: 0
Thanks Received: 0

I need to change a Lower indicator to be an UP indicator with the candles with an arrow signals

the indicator in THINKORSWIM is named ( StochasticSlow ). it is a lower indicator as in the chart down :



What I want to change are :

1- make this indicator UP with the candles.
2- remove Slow K.
3- make up arrow signal when the ( Slow D) crosses the oversell line up ---> arrow up ( means BUY )
4- make down arrow signal when the ( Slow D) crosses the overbuy line from up to down ---> ( means SELL )


If any one can make this changes her is the script :

===

#
# TD Ameritrade IP Company, Inc. (c) 2008-2014
#

declare lower;

input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input smoothingType = {Default SMA, EMA};

plot SlowK = reference StochasticFull(over_bought,over_sold,KPeriod,DPeriod,priceH,priceL,priceC,3,smoothingType).FullK;
SlowK.setDefaultColor(GetColor(5));

plot SlowD = reference StochasticFull(over_bought,over_sold,KPeriod,DPeriod,priceH,priceL,priceC,3,smoothingType).FullD;
SlowD.setDefaultColor(GetColor(0));

plot OverBought = over_bought;
OverBought.SetDefaultColor(GetColor(1));

plot OverSold = over_sold;
OverSold.SetDefaultColor(GetColor(1));

====


best regards ,,

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
Exit Strategy
NinjaTrader
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
28 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #2 (permalink)
 kingfish88 
Las Vegas
 
Experience: Beginner
Platform: NinjaTrader
Broker: Zen-Fire
Trading: ES
Posts: 14 since Jun 2009
Thanks Given: 66
Thanks Received: 2

1- make this indicator UP with the candles.
==> change declare to upper.
2- remove Slow K.
put ## in front of plot slowK

Dont know how to do 3, 4 yet.

3- make up arrow signal when the ( Slow D) crosses the oversell line up ---> arrow up ( means BUY )
4- make down arrow signal when the ( Slow D) crosses the overbuy line from up to down ---> ( means SELL )

Follow me on Twitter Reply With Quote
  #3 (permalink)
 
rmejia's Avatar
 rmejia 
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: Options
Posts: 379 since Oct 2010
Thanks Given: 3,614
Thanks Received: 441


To hide a plot you can uncheck "Show Plot" in the preferences.

This is for arrows above as show on the attached image:

 
Code
input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 10;
input priceH = high;
input priceL = low;
input priceC = close;
input smoothingType = {Default SMA, EMA};

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


# ARROWS 
plot Up = if (Crosses(SlowD,OverSold)and SlowD > OverSold, close,double.nan);
Up.setLineWeight(5);
Up.setDefaultColor(color.green);
Up.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_UP);
Up.HideBubble();

plot Down = if (Crosses(slowD,OverBought)and slowD < OverBought, close,double.nan);
Down.setLineWeight(5);
Down.setDefaultColor(color.red);
Down.setPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_DOWN);
Down.HideBubble();


Reply With Quote
Thanked by:
  #4 (permalink)
Martzee
Vail, CO USA
 
Posts: 12 since Jan 2015
Thanks Given: 6
Thanks Received: 9

Hello rmejia,

I reviewed your code of adding arrows to the oscillator but I am having a problem with it as it tries to add those arrows into the same lower window as Stochastic is. When I change declaration to upper, it moves everything, even the Stochastic to upper window and it messes up the price chart. When the arrows are in the lower window, it messes up the stochastic chart.

I wanted to submit pictures but since I am new here I cannot do that.



I would like the arrows to be plotted in the same window as the stochastic oscillator is rather than in the price window. Is it possible and how to do that?

Actually I would like to have the same in MACD window. What I would like to achieve is the following:

1) If Stochastic SlowK crosses SlowD in overbought territory (above 85) plot a red arrow down in the stochastic window

2) If MACD value crosses Avg down plot a red in the MACD window

3) If Stochastic is Slowk crossed SlowD and MACD Value crossed Avg down plot red arrow in price chart

The price chart arrows will be plotted only if the steps #1 and #2 are true. That would be a sell signal, the buy signal would be the opposite.

I wanted to submit pictures but since I am new here I cannot do that.

I uploaded images to my website where you can look at them:

hellosuckers . net / images / StochStudy.png

and .

../ StochResult.png

Hope this will get you an idea what I want to achieve and hope this won't get me banned.


Is there a way to program it to generate buy and sell signals based on described above? Can anyone help?

Thanks a lot!

Martin

Reply With Quote
  #5 (permalink)
 
rmejia's Avatar
 rmejia 
Puerto Rico
 
Experience: Intermediate
Platform: thinkorswim
Broker: TD Ameritrade
Trading: Options
Posts: 379 since Oct 2010
Thanks Given: 3,614
Thanks Received: 441


Martzee View Post
I reviewed your code of adding arrows to the oscillator but I am having a problem with it as it tries to add those arrows into the same lower window as Stochastic is. When I change declaration to upper, it moves everything, even the Stochastic to upper window and it messes up the price chart. When the arrows are in the lower window, it messes up the stochastic chart.

I copy pasted the code to a new script and by default it placed itself in the "Price" area for studies since there was no "declare lower". To get it lower I had to move it, and to get it together with the Stochastics Slow had to put it there but the script I posted was quickly done with just the intention of having it in the price.

The OP asked for the same indicator in the yahoo! thinkscript group and Jaime Pinto gave him a nice complete package study. He did a PINTO_StochasticSlow study that looks like it does what you need. Here is the link to the thread:
https://www.yahoo.com/

I have not played around with Strategies in TOS forever but what you are asking for could perhaps be done there, if not it would be with 3 different studies. The strategies tool in TOS is very limited and has little control so many times a profitable strategy will not really be profitable because the entries and exits are not real. There is no way to automatically set TOS to buy and sell on signals and strategies. For that something like NinjaTrader could be used. There is a thread for NinjaTrader strategies that could provide some guidance on creating strategies:

Attached Thumbnails
Click image for larger version

Name:	arrows.jpg
Views:	328
Size:	351.4 KB
ID:	170404  
Reply With Quote




Last Updated on January 2, 2015


© 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