NexusFi: Find Your Edge


Home Menu

 





Autohiding for Fibonacci Retracements With Extentions


Discussion in ThinkOrSwim

Updated
    1. trending_up 3,898 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Autohiding for Fibonacci Retracements With Extentions

  #1 (permalink)
 
zentrade's Avatar
 zentrade 
Wilson, NC
 
Experience: Intermediate
Platform: thinkorswim
Trading: NQ
Posts: 18 since Dec 2010
Thanks Given: 1
Thanks Received: 5

Can anyone with great thinkscript skills modify or know how to modify the "Fibonacci Retracements With Extentions" script in the downloads section to auto hide the lines that are far away from current price? I'm not good with thinkscript.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
Exit Strategy
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
30 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)
 
Massive l's Avatar
 Massive l 
OR/USA
Legendary /NQ Trader
 
Experience: None
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,106

I didn't know that was a script, I just thought it was a drawing.

I don't know about auto hiding n points away from price or anything but Prospectus has
show yes or no in his auto fib script.

# Automatic Opening Range and Fibonacci Levels
# By Prospectus @ Read the Prospectus
# Inspired by Trader-X @ Trader-X...views from a distorted mind.
#
# This Thinkscript is designed to plot the OR high, low,
# 50% fib retrace, and fib extensions for the current day.
# This will only work correctly on time-based charts,
# where the OR timeframe is divisible by the bar period
# e.g. 30 minute OR, 10 min bars. An extra fib extension
# may be used if desired to create a target zone.
#
def na=double.nan;
#
# Define time that OR begins (in hhmm format,
# 0930 is the default):
#
input ORBegin = 0930;
#
# Define time that OR is finished (in hhmm format,
# 10:00 is the default):
#
input OREnd = 1000;
#
# Input first and second fib extension levels
# (default 1.382, 1.621):
#
Input FibExt1=1.382;
Input FibExt2=1.621;
#
# Show Today only? (Default Yes)
#
input ShowTodayOnly={"No", default "Yes"};
def s=ShowTodayOnly;
#
# Show Second fib extension? (Default No)
#
input ShowFibExt2={default "No", "Yes"};
def sf2=ShowFibExt2;
#
# Create logic for OR definition:
#
Def ORActive = if secondstilltime(OREnd)>0 AND secondsfromtime(ORBegin)>=0 then 1 else 0;
#
# Create logic to paint only current day post-open:
#
def today=if s==0 OR getday()==getlastday() AND secondsfromtime(ORBegin)>=0 then 1 else 0;
#
# Track OR High:
#
Rec ORHigh = if ORHigh[1]==0 or ORActive[1]==0 AND ORActive==1 then high else if ORActive AND high>ORHigh[1] then high else ORHigh[1];
#
# Track OR Low:
#
Rec ORLow = if ORLow[1]==0 or ORActive[1]==0 AND ORActive==1 then low else if ORActive AND low<ORLow[1] then low else ORLow[1];
#
# Calculate OR width:
#
Def ORWidth = ORHigh - ORLow;
#
# Calculate fib levels:
#
Def fib_mid = (ORHigh+ORLow)/2;
Def fib_ext_up1 = ORHigh + ORWidth*(FibExt1 - 1);
Def fib_ext_down1 = ORLow - ORWidth*(FibExt1 - 1);
Def fib_ext_up2= ORHigh + ORWidth*(FibExt2 - 1);
Def fib_ext_down2 = ORLow - ORWidth*(FibExt2 - 1);
#
# Define all the plots:
#
Plot ORH=if ORActive OR today<1 then na else ORHigh;
Plot ORL=if ORActive OR today<1 then na else ORLow;
Plot FibMid=if ORActive OR today<1 then na else fib_mid;
Plot FibExtUp1=if ORActive OR today<1 then na else fib_ext_up1;
Plot FibExtDown1=if ORActive OR today<1 then na else fib_ext_down1;
Plot FibExtUp2=if ORActive OR today<1 OR sf2<1 then na else fib_ext_up2;
Plot FibExtDown2=if ORActive OR today<1 OR sf2<1 then na else fib_ext_down2;
#
# Formatting:
#
ORH.setdefaultcolor(color.green);
ORH.setStyle(curve.Long_DASH);
ORH.setlineweight(3);
ORL.setdefaultcolor(color.red);
ORL.setStyle(curve.Long_DASH);
ORL.setlineweight(3);
FibMid.setdefaultcolor(color.gray);
FibMid.setStyle(curve.SHORT_DASH);
FibMid.setlineweight(3);
FibExtUp1.setdefaultcolor(color.green);
FibExtUp1.setStyle(curve.SHORT_DASH);
FibExtUp1.setlineweight(2);
FibExtDown1.setdefaultcolor(color.red);
FibExtDown1.setStyle(curve.SHORT_DASH);
FibExtDown1.setlineweight(2);
FibExtUp2.setdefaultcolor(color.green);
FibExtUp2.setStyle(curve.SHORT_DASH);
FibExtUp2.setlineweight(1);
FibExtDown2.setdefaultcolor(color.red);
FibExtDown2.setStyle(curve.SHORT_DASH);
FibExtDown2.setlineweight(1);

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
 
zentrade's Avatar
 zentrade 
Wilson, NC
 
Experience: Intermediate
Platform: thinkorswim
Trading: NQ
Posts: 18 since Dec 2010
Thanks Given: 1
Thanks Received: 5


Thanks Massive for this script. But the lines in that script don't autohide like I was looking for. I wonder If what I'm looking for is even possible.

Started this thread Reply With Quote
  #4 (permalink)
 RickD 
Los Angeles, CA
 
Experience: Intermediate
Platform: TOS, TradeStation
Trading: TF
Posts: 5 since Sep 2012
Thanks Given: 10
Thanks Received: 1

Thanks for this script -- just ran across it. It wasn't exactly what I was looking for either -- BUT -- it gave me enough of a start so that I could finish the job on my own. Like all repetitive and learned activities, learning how to code in thinkscript (or any other scripting language ) just takes practice and more practice. Seeing good examples of code like this has sure helped me more than any other thing in terms of getting started in learning this language.

Reply With Quote




Last Updated on May 8, 2013


© 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