Williams Fractals for TradeStation - TradeStation | futures io social day trading
futures io futures trading


Williams Fractals for TradeStation
Updated: Views / Replies:303 / 4
Created: by lrc11239 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Williams Fractals for TradeStation

  #1 (permalink)
Brooklyn NY USA
 
 
Posts: 5 since Jul 2019
Thanks: 1 given, 0 received

Williams Fractals for TradeStation

Hello all, I'm new to TradeStation and this forum. Thank you for so much information. I've been trying to find the Williams Fractal plots for Tradestation. I'm currently using Thinkorswim and have them there but I'm switching my day trading platform to Tradestation and I'm not sure if they have the Fractals I'm using. I've tried to call the Tech department and they really don't know if the platform has them. Does anyone know if Tradestation has the Williams Fractal plots? I've also included the ThinkScript codes if anyone is able to convert to EasyLanguage would be much appreciated. Many thanks as always!!


#wizard plots
#wizard text: Inputs: sequence count:
#wizard input: sequenceCount

input sequenceCount = 2;

def maxSideLength = sequenceCount + 10;
def upRightSide = fold i1 = 1 to maxSideLength + 1 with count1 while count1 != sequenceCount and count1 != -1 do
if GetValue(high, -i1, -maxSideLength) > high or (GetValue(high, -i1, -maxSideLength) == high and count1 == 0) then -1
else if GetValue(high, -i1, -maxSideLength) < high then count1 + 1 else count1;
def upLeftSide = fold i2 = 1 to maxSideLength + 1 with count2 while count2 != sequenceCount and count2 != -1 do
if GetValue(high, i2, maxSideLength) > high or (GetValue(high, i2, maxSideLength) == high and count2 >= 1) then -1
else if GetValue(high, i2, maxSideLength) < high then count2 + 1 else count2;

def downRightSide = fold i3 = 1 to maxSideLength + 1 with count3 while count3 != sequenceCount and count3 != -1 do
if GetValue(low, -i3, -maxSideLength) < low or (GetValue(low, -i3, -maxSideLength) == low and count3 == 0) then -1
else if GetValue(high, -i3, -maxSideLength) > low then count3 + 1 else count3;
def downLeftSide = fold i4 = 1 to maxSideLength + 1 with count4 while count4 != sequenceCount and count4 != -1 do
if GetValue(low, i4, maxSideLength) < low or (GetValue(low, i4, maxSideLength) == low and count4 >= 1) then -1
else if GetValue(low, i4, maxSideLength) > low then count4 + 1 else count4;

plot UpFractal = if upRightSide == sequenceCount and upLeftSide == sequenceCount then high else Double.NaN;
plot DownFractal = if downRightSide == sequenceCount and downLeftSide == sequenceCount then low else Double.NaN;

UpFractal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_UP);
UpFractal.SetDefaultColor(GetColor(3));
UpFractal.SetLineWeight(2);
DownFractal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);
DownFractal.SetDefaultColor(GetColor(4));
DownFractal.SetLineWeight(2);

Reply With Quote
 
  #2 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Trading Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 2,070 since Apr 2013
Thanks: 370 given, 1,321 received

lrc11239,

welcome to futures.io. You might be able to find an indicator that does what you want in the official Tradestation forum. For example this one might work for you: https://community.tradestation.com/Discussions/Topic.aspx?Topic_ID=60258

Regards,

ABCTG

Follow me on Twitter Visit my Facebook Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #3 (permalink)
Plainview
 
Trading Experience: Intermediate
Platform: TradeStation
Broker/Data: TradeStation
Favorite Futures: Futures
 
Posts: 7 since Mar 2012
Thanks: 0 given, 10 received


I find that this code works pretty well [not sure it's exactly the same, but it's pretty close]
For Lows (I plot PaintBars with slightly thick plots in the lower half of the bar, so this is paintbar study code; it works best on bars rather than candles):
 
Code
Input:
		MyStrength(2);

If SwingLow(1,L,MyStrength,MyStrength + 1) <> -1 {and L[2] <> L[4]} then begin
	 CommentaryCL("Action Bar");
	 If Low[MyStrength] < Low[MyStrength + 1] then begin
	 	PlotPB[MyStrength](0.5*(H+L)[MyStrength],(SwingLow(1,L,MyStrength,MyStrength + 1)),"FrctlL");
	 	If AlertEnabled then Alert("Fractal Low Formed " + GetSymbolName);
	 	end
	 	Else 
	 	begin
	 		PlotPB[MyStrength + 1]((SwingLow(1,L,MyStrength,MyStrength + 2)),(H[MyStrength + 1]+L[MyStrength + 1])/2,"FrctlL");
	 	 	If AlertEnabled then Alert("Fractal Low Formed " + GetSymbolName);
	 	end;
end
Else
	Begin
		NoPlot(1);
		NoPlot(2);
	End;
For Highs:
 
Code

Input:
		MyStrength(2);
If SwingHigh(1,H,MyStrength,MyStrength + 1) <> -1 {and H[2] <> H[4]} then begin
	 CommentaryCL("Action Bar");
	 If High[MyStrength] > High[MyStrength + 1] then begin
	 	PlotPB[MyStrength]((SwingHigh(1,H,MyStrength,MyStrength + 1)),(H[MyStrength]+L[MyStrength])/2,"FrctlH");
	 	If AlertEnabled then Alert("Fractal High Formed " + GetSymbolName);
	 	end
	 	Else 
	 	begin
	 	 	PlotPB[MyStrength + 1]((SwingHigh(1,H,MyStrength,MyStrength + 2)),(H[MyStrength + 1]+L[MyStrength + 1])/2,"FrctlH");
	 	 	If AlertEnabled then Alert("Fractal High Formed " + GetSymbolName);
	 	end;	 
end
Else
	Begin
		NoPlot(1);
		NoPlot(2);
	End;


Last edited by TraderDoc2; July 30th, 2019 at 10:48 AM.
Follow me on Twitter Reply With Quote
 
  #4 (permalink)
ALBANY Oregon USA
 
Trading Experience: Intermediate
Platform: MultiCharts
Favorite Futures: eMini ES
 
QCDragon's Avatar
 
Posts: 1 since Feb 2016
Thanks: 0 given, 0 received

From Bill Williams himself...

 
Code
[LegacyColorValue = TRUE];

{  ---------------------------------------------------------------------  
   --   SHOW: FRACTAL-SQUATS Study                                    --  
   --                                                                 --  
   --   Developed by Bill Williams                                    --  
   --   Easy Language Programing by:  Bill Williams                  --  
   --
   --   Copyright by Bill Williams - Profitunity Trading Group        --  
   ---------------------------------------------------------------------  
  See Profitunity Manual for information on how to apply this STUDY.

  These FRACTAL formation will be identified by this logic:            
                      Rising Markets:

        | |         |        |||       ||      ||||      |||||
       | | |       | |      |   |     |  |    |    |    |     |
      |     |     |   |    |     |   |    |  |      |  |       |
 ___________________________________________________________________
   
      |     |     |   |    |     |   |    |  |      |  |       |
       | | |       | |      |   |     |  |    |    |    |     |
        | |         |        |||       ||      ||||      |||||
                
                      Declining Markets:
   Additional formations can be added by placing the appropriate code in the       User functions:  
           UpFractal 
           DownFractal

   and by adding the logic in this study for determining where to place the    Fractal/Squat identifier.
   NOTE:   Documentation was limited by File Size Restrictions.}

INPUT: PtsInTic(1), TicExpnd(1);
VAR :  UpHump(FALSE), DownHump(FALSE), Expansion(0), Move(0);

UpHump = UpFractal = 1;

DownHump = DownFractal = 1;

IF TicExpnd >= MinimumMove THEN
   Move = TicExpnd
 ELSE
   Move = MinimumMove;

Expansion = Move * PtsInTic;

IF UpHump THEN
	BEGIN
		IF H[2] >= H[3] AND H[2] > H[4] THEN Plot1[2](HIGH[2] + Expansion Points,"UpHump");
		IF H[2] = H[3] AND H[3] = H[4] THEN Plot1[2](HIGH[2] + Expansion Points,"UpHump");
		IF H[2] > H[3] AND H[2] = H[4] THEN Plot1[2](HIGH[2] + Expansion Points,"UpHump");
		IF H[2] = H[3] AND H[3] = H[4] AND H[4] = H[5] THEN Plot1[2](HIGH[2] + Expansion Points,"UpHump");        
		IF H[2] = H[3] AND H[3] = H[4] AND H[4] = H[5] AND H[5] = H[6] THEN Plot1[2](HIGH[2] + Expansion Points,"UpHump"); 
	END;

IF DownHump THEN
	BEGIN
		IF L[2] <= L[3] AND L[2] < L[4] THEN Plot2[2](LOW[2] - Expansion Points,"DwnHump");
		IF L[2] = L[3] AND L[3] = L[4] THEN Plot2[2](LOW[2] - Expansion Points,"DwnHump");
		IF L[2] < L[3] AND L[2] = L[4] THEN Plot2[2](LOW[2] - Expansion Points,"DwnHump");
		IF L[2] = L[3] AND L[3] = L[4] AND L[4] = L[5] THEN Plot2[2](LOW[2] - Expansion Points,"DwnHump");
		IF L[2] = L[3] AND L[3] = L[4] AND L[4] = L[5] AND L[5] = L[6] THEN Plot2[2](LOW[2] - Expansion Points,"DwnHump");
       END;
The following is a NEWER version, but there are LESS examples:

 
Code
{ 
  *******************************
 *********************************
***                             *** 
***  FRACTAL PATTERNS           ***
***  PROFITUNITY TRADING GROUP  ***
***                             *** 
 *********************************
  *******************************
}

{ STEP 1: Replace <CRITERIA> with the logical criteria that will trigger the placement 
  of a ShowMe marker on the chart, such as Close > Close[1].  Note that Condition1 is a 
  logical variable, a temporary holding place for the true-false result of your 
  criteria. }

Condition1 = H[2] > H[3] and H[2] > H[4] and H[2] > H[1] and H[2] > H;
Condition2 = L[2] < L[3] and L[2] < L[4] and L[2] < L[1] and L[2] < L;

{ OPTIONAL STEP: Replace CLOSE with your own formula for the price at which the marker 
  will be placed.  Note that Value1 is a numeric variable, a temporary holding place 
  for the result of the numeric formula. }

Value1 = H[2] ;
Value2 = L[2];

{ Leave the following as is.  The plot is not named because there is only one plot, and 
  the default name Plot1 will be adequate.  The alert does not include a description 
  because the alerting criteria and the plotting criteria are the same, and the 
  description will be redundant. }

if Condition1 then 	Plot1[2]( Value1, "Fractal H", Green) ;
If Condition2 then  Plot2[2]( Value2, "Fractal L", Red);

Reply With Quote
 
  #5 (permalink)
Phoenix Arizona
 
 
Posts: 1 since Jul 2019
Thanks: 0 given, 1 received

Williams Fractals

Hello, Also new to the forum. I am using Tradestation 9.5 Update 28 and it has the Williams Fractal, it is a "Show Me", so you have to click over 1 tab to the right when you go to add an indicator and select the ShowMe options.

Or perhaps I some how picked this up along the way from someone. Anyway here is the code.

{ Search Tag: WA-Fractals }

{ Reference: Bill Williams, PhD, "New Trading Dimensions" (John Wiley & Sons, Inc.,
1998) }

{
This study works in Charting only.

High and Low fractals are identified per Chapter 4 (see reference above). A
minimum of 5 bars are required to identify the pattern.

For a High fractal, the fractal bar must have 2 bars on the right and 2 bars on
the left that have lower Highs. For the bars to the left, a bar that has the same
High cannot be counted as one of the 2 'lower' bars. For the bars to the right of
the fractal bar, you can't have a bar with a High that equals the high of the
fractal bar, which invalidates the pattern. This can be seen in the examples
found in Figure 4-4 (see reference above).

Low fractals are similar, but use Low prices.
}

using elsystem;
using elsystem.collections;

inputs:
int HighStrength( 2 )[DisplayName = "HighStrength", ToolTip =
"Enter the number of bars required to identify a fractal high."],
int LowStrength( 2 )[DisplayName = "LowStrength", ToolTip =
"Enter the number of bars required to identify a fractal low."],
int ShowFractalHighs( 1 ) [DisplayName = "ShowFractalHighs", ToolTip =
"Enter 1 to mark the fractal highs. Enter any other value to prevent marking of the fractal highs."],
int FractalHighOffsetTicks( 1 ) [DisplayName = "FractalHighOffsetTicks", ToolTip =
"Set to the number of ticks that the marker will be offset above the fractal high price."],
int ShowFractalLows( 1 ) [DisplayName = "ShowFractalLows", ToolTip =
"Enter 1 to mark the fractal lows. Enter any other value to prevent marking of the fractal lows."],
int FractalLowOffsetTicks( 1 ) [DisplayName = "FractalLowOffsetTicks", ToolTip =
"Set to the number of ticks that the marker will be offset below the fractal low price."];

variables:
Vector VectorOfHighs( NULL ),
Vector VectorOfLows( NULL ),
intrabarpersist int MinHighBarsNeeded( 0 ),
intrabarpersist int MinLowBarsNeeded( 0 ),
intrabarpersist double LastFractalHighPrice( -1 ),
intrabarpersist double LastFractalLowPrice( -1 ),
intrabarpersist int NumberOfDecimals( 2 ),
bool FractHighFound( false ),
bool FractLowFound( false ),
intrabarpersist double HighOffset( 0 ),
intrabarpersist double LowOffset( 0 );

{ search for Fractal 'high' pattern }
method bool FractalHighFound()
variables:
int Counter,
bool HighFound,
bool OkToContinue,
double RefHigh,
int NumLowerHighsFound;
begin
HighFound = false; { initialize }
OkToContinue = true; { initialize }

if VectorOfHighs.Count >= MinHighBarsNeeded then { ensure bars are available }
begin
RefHigh = VectorOfHighs[HighStrength] astype double;

{ the High of 'Strength' bars ago must be higher than the current bar and
all of the other subsequent bars after 'Strength' bars ago }
for Counter = 0 to HighStrength - 1
begin
if VectorOfHighs[Counter] astype double >= RefHigh then
begin
OkToContinue = false;
break;
end;
end;

{ check the bars to the left of the reference bar for 'Strength' lower
highs than the RefHigh (without exceeding the RefHigh) }
if OkToContinue then { first condition was met }
begin
for Counter = HighStrength + 1 to VectorOfHighs.Count - 1
begin
if VectorOfHighs[Counter] astype double < RefHigh then
begin
NumLowerHighsFound += 1;
if NumLowerHighsFound = HighStrength then
begin
HighFound = true;
LastFractalHighPrice = RefHigh;
break;
end;
end
else if VectorOfHighs[Counter] astype double > RefHigh then
begin
break;
end;
end;
end;
end;

return HighFound;
end;

{ search for Fractal 'low' pattern }
method bool FractalLowFound()
variables:
int Counter,
bool LowFound,
bool OkToContinue,
double RefLow,
int NumHigherLowsFound;
begin
LowFound = false; { initialize }
OkToContinue = true; { initialize }

if VectorOfLows.Count >= MinLowBarsNeeded then { ensure bars are available }
begin
RefLow = VectorOfLows[LowStrength] astype double;

{ the Low of 'Strength' bars ago must be lower than the current bar and
all of the other subsequent bars after 'Strength' bars ago }
for Counter = 0 to LowStrength - 1
begin
if VectorOfLows[Counter] astype double <= RefLow then
begin
OkToContinue = false;
break;
end;
end;

{ check the bars to the left of the reference bar for 'Strength' higher
lows than the RefLow (without exceeding the RefLow }
if OkToContinue then { first condition was met }
begin
for Counter = LowStrength + 1 to VectorOfLows.Count - 1
begin
if VectorOfLows[Counter] astype double > RefLow then
begin
NumHigherLowsFound += 1;
if NumHigherLowsFound = LowStrength then
begin
LowFound = true;
LastFractalLowPrice = RefLow;
break;
end;
end
else if VectorOfLows[Counter] astype double < RefLow then
begin
break;
end;
end;
end;
end;

return LowFound;
end;

{ initialization and error checking of input values }
once
begin
if ShowFractalHighs <> 1
and ShowFractalLows <> 1 then
begin
throw Exception.Create( !( "Both fractal highs and fractal lows are set to not show." ) );
end;

if HighStrength < 2 then
throw Exception.Create( !( "HighStrength input must be at least 2." ) );

if LowStrength < 2 then
throw Exception.Create( !( "LowStrength input must be at least 2." ) );

HighOffset = FractalHighOffsetTicks * MinMove / PriceScale;
LowOffset = FractalLowOffsetTicks * MinMove / PriceScale;

MinHighBarsNeeded = HighStrength * 2 + 1;
MinLowBarsNeeded = LowStrength * 2 + 1;
NumberOfDecimals = NumDecimals( PriceScale );

VectorOfHighs = new Vector();
VectorOfLows = new Vector();
end;

{ the confirmation and marking of a fractal/pivot can only be determined at
the close of the bar; note that the "DataNum" property of the AnalysisTechnique
class starts at zero for Data1 so it must be incremented by 1 to correspond to
the data stream to be used with BarStatus}

if BarStatus( DataNum + 1 ) = 2 then
begin
{on each bar load the bar High and Low into respective vector; Vectors are used
so that the pattern recognition code can 'loop back' through prices (in the
Vectors) without affecting MaxBarsBack}

VectorOfHighs.Insert( 0, High astype double );
VectorOfLows.Insert( 0, Low astype double );

FractHighFound = FractalHighFound();
FractLowFound = FractalLowFound();

if FractHighFound and ShowFractalHighs = 1 then
Plot1[HighStrength]( High[HighStrength] + HighOffset, !( "FractHigh" ) );

if FractLowFound and ShowFractalLows = 1 then
Plot2[LowStrength]( Low[LowStrength] - LowOffset, !( "FractLow" ) );

{ alerts }
if AlertEnabled then
begin
if FractHighFound then
Alert( !( "Fractal high found at: " ) + NumToStr( LastFractalHighPrice,
NumberOfDecimals ) );

if FractLowFound then
Alert( !( "Fractal low found at: " ) + NumToStr( LastFractalLowPrice,
NumberOfDecimals ) );
end;
end;


{ ** Copyright © TradeStation Technologies, Inc. All Rights Reserved **
** TradeStation reserves the right to modify or overwrite this analysis technique
with each release. ** }

Reply With Quote
The following user says Thank You to dlaz758 for this post:

Reply



futures io > > > > Williams Fractals for TradeStation




Upcoming Webinars and Events (4:30PM ET unless noted)
 

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$1,000 in Amazon Gift Cards being given away right now from GFF Brokers

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Show us your trading desks and win over $5,000 in prizes w/Jigsaw Trading

August
 

Webinar: Suri Duddella (TBA)

Elite only
 

Webinar: Richard Bailey (TBA)

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Better Fractals Study idude Sierra Chart 3 July 3rd, 2015 04:39 PM
Fractals Big Mike The Elite Circle 47 March 20th, 2015 02:24 PM
FRACTALS... ecoexplorer TradeStation 6 June 6th, 2014 05:43 PM
Trading Fractals, Multiple Trendlines and Momentum tdaman NinjaTrader 15 February 15th, 2014 10:03 PM
Where did the Fractals Indicator go? tdaman NinjaTrader 3 June 9th, 2011 06:59 PM


All times are GMT -4. The time now is 03:38 PM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts