TheStrategyLab.com Price Action Trading Support Forum

Forum for price action traders that want to learn WRB Analysis basic tutorial chapters 1, 2 and 3 prior to purchasing our advance trade methods. Hashtags: #wrbanalysis #wrbzone #wrbhiddengap #priceaction #trading
It is currently Thu Mar 28, 2024 1:39 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Multicharts Wide Range Body Code
PostPosted: Fri Jun 16, 2017 5:52 am 
Offline

Joined: Wed Jun 14, 2017 5:20 am
Posts: 12
This is something I knocked up on arriving here. I find codifying things useful as you really get to understand the principles and ramifications of what you re coding. It only does Wide Range Bodies currently (laziness) though would only take 5 minutes to add an option for Bars. let me know if you would like me to add that as an option. It probably will work in tradestation too. Set Plots 1 and 2 to HiLo bar to highlight WRBHG's.

Code:
Input:

BarsBack(3),
PlotWRBgap(true),
PlotWRB(true);

var:

lastbarWRB(false),WRBgap(false),
range(0);

if lastbarWRB and PlotWRBgap then begin
   if (h[2] < l) then begin
      plot1 [1](h[2]);
      plot2 [1](l);
   end;
   if (l[2] > h) then begin
      plot1[1](l[2]);
      plot2 [1](h);
   end;
   lastbarWRB = false;
end;


range = absvalue (o-c);
if range = highest(range,BarsBack+1) then begin
   lastbarWRB = true;
   if PlotWRB and  (o-c) < 0 then plot3(l);
   if PlotWRB and (o-c) >= 0 then plot3(h);
end;

Attachment:
MultiCharts12.png
MultiCharts12.png [ 61.17 KiB | Viewed 486 times ]

Attachment:
MultiCharts13.png
MultiCharts13.png [ 49.41 KiB | Viewed 514 times ]

Attachment:
MultiCharts14.png
MultiCharts14.png [ 77.64 KiB | Viewed 463 times ]


Top
 Profile  
 
 Post subject: Re: Multicharts Wide Range Body Code
PostPosted: Fri Jun 16, 2017 8:14 am 
Offline
Site Admin

Joined: Sat Jan 10, 2009 2:06 pm
Posts: 4335
Location: Canada
Hi,

Thanks for sharing your code for multicharts.

I have a question...does your code identify WRB Hidden Gap intervals differently from WRB intervals via color ?

Also, it looks like in your code you're using the RANGE to determine WRBs instead of the difference between Close & Open ?

If so, that's ok but many others (including myself) don't use the range.

Regards,
M.A. Perry
TheStrategyLab


Top
 Profile  
 
 Post subject: Re: Multicharts Wide Range Body Code
PostPosted: Fri Jun 16, 2017 11:55 am 
Offline

Joined: Wed Jun 14, 2017 5:20 am
Posts: 12
<deleted>


Last edited by NickA on Fri Jun 16, 2017 12:32 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Multicharts Wide Range Body Code
PostPosted: Fri Jun 16, 2017 12:15 pm 
Offline

Joined: Wed Jun 14, 2017 5:20 am
Posts: 12
Unless there is a logic error (quite possible!) the indicator places a dot above any downward Wide Range Body interval or below any upward Wide Range Body interval. (purple in the examples). These intervals don't need have hidden gaps. This can be switched on or off. You can also select how many bars back to look (default 3).

If it detects a WRBody it will look for a hidden gap by checking next interval low > previous interval high OR next interval high < previous interval low. It displays this as a background on that interval (blue in the examples). It is displayed from previous interval h/l to subsequent interval l/h.

wrbtrader wrote:
Hi,

Thanks for sharing your code for multicharts.

I have a question...does your code identify WRB Hidden Gap intervals differently from WRB intervals via color ?

Also, it looks like in your code you're using the RANGE to determine WRBs instead of the difference between Close & Open ?

If so, that's ok but many others (including myself) don't use the range.

Regards,
M.A. Perry
TheStrategyLab


Last edited by NickA on Fri Jun 16, 2017 12:40 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Multicharts Wide Range Body Code
PostPosted: Fri Jun 16, 2017 12:29 pm 
Offline

Joined: Wed Jun 14, 2017 5:20 am
Posts: 12
Example image demonstrating logic note dots signify any WRBody highlights hidden gaps.

Attachment:
MultiCharts21.png
MultiCharts21.png [ 41.37 KiB | Viewed 546 times ]


And finally how one would probably use it with only WRBody hidden gaps shown.

Attachment:
MultiCharts22.png
MultiCharts22.png [ 37.82 KiB | Viewed 473 times ]


Top
 Profile  
 
 Post subject: Re: Multicharts Wide Range Body Code
PostPosted: Tue Jun 20, 2017 6:22 am 
Offline

Joined: Wed Jun 14, 2017 5:20 am
Posts: 12
To avoid confusion an updated version where you can select Wide Range Bodies or Wide Range Bars. I couldn't edit the first post I, guess there is a timer on edits.
Code:
Input:

BarsBack(3),
Bodies(true),
PlotWRBgap(true),
PlotWRB(true);

var:

lastbarWRB(false),WRBgap(false),
spacer(0),
range(0);

if lastbarWRB and PlotWRBgap then begin
   if (h[2] < l) then begin
      plot1 [1](h[2]);
      plot2 [1](l);
   end;
   if (l[2] > h) then begin
      plot1[1](l[2]);
      plot2 [1](h);
   end;
   lastbarWRB = false;
end;


if bodies then range = absvalue (o-c) else range = absvalue (h-l);
spacer = averagetruerange(13) /13;
if range = highest(range,BarsBack+1) then begin
   lastbarWRB = true;
   if PlotWRB and  (o-c) < 0 then plot3(l-spacer);
   if PlotWRB and (o-c) >= 0 then plot3(h+spacer);
end;



Bodies
Attachment:
MultiCharts24.png
MultiCharts24.png [ 49.88 KiB | Viewed 487 times ]


Bars
Attachment:
MultiCharts25.png
MultiCharts25.png [ 44.06 KiB | Viewed 456 times ]


Top
 Profile  
 
 Post subject: Re: Multicharts Wide Range Body Code
PostPosted: Tue Jun 20, 2017 2:30 pm 
Offline

Joined: Wed Jun 14, 2017 5:20 am
Posts: 12
I should read more carefully. Senility. Added option to plot hidden gaps as hidden gaps or full bodies.

Code:
Input:

BarsBack(3),
BodiesNotBars(true),
PlotWRBgap(true),
PlotWRB(true),
PLotHGasWholeBody(true);

var:

lastbarWRB(false),WRBgap(false),
spacer(0),
range(0);

if lastbarWRB and PlotWRBgap then begin
   if PlotHGasWholeBody then begin
      plot1 [1] (o[1]);
      plot2 [1] (c[1]);
   end
   else begin
      if (h[2] < l) then begin
         plot1 [1](h[2]);
         plot2 [1](l);
      end;
      if (l[2] > h) then begin
         plot1[1](l[2]);
         plot2 [1](h);
      end;
   end;
   lastbarWRB = false;
end;


if bodiesnotbars then range = absvalue (o-c) else range = absvalue (h-l);
spacer = averagetruerange(13) /13;
if range = highest(range,BarsBack+1) then begin
   lastbarWRB = true;
   if PlotWRB and  (o-c) < 0 then plot3(l-spacer);
   if PlotWRB and (o-c) >= 0 then plot3(h+spacer);
end;


Attachment:
Untitled.png
Untitled.png [ 46.71 KiB | Viewed 472 times ]


Top
 Profile  
 
 Post subject: Re: Multicharts Wide Range Body Code
PostPosted: Wed Jun 21, 2017 2:17 am 
Offline

Joined: Wed Jun 14, 2017 5:20 am
Posts: 12
Fixed bug in the full body plot
Code:
Input:

BarsBack(3),
BodiesNotBars(true),
PlotWRBgap(true),
PlotWRB(true),
PLotHGasWholeBody(true);

var:

lastbarWRB(false),WRBgap(false),hg(false),
spacer(0),
range(0);

if lastbarWRB and PlotWRBgap then begin
   if (h[2] < l) then begin
      hg = true;
      value1 = h[2];
      value2 =l;
   end;
   if (l[2] > h) then begin
      hg = true;
      value1 = l[2];
      value2 = h;
   end;
   if PlotHGasWholeBody then begin      // clearer to simply overide value 1 and 2
      value1 = o[1];
      value2 = c[1];
   end;

   if hg then begin
      plot1 [1](value1);
      plot2 [1](value2);
   end;
   lastbarWRB = false;
   hg = false;   
end;


if bodiesnotbars then range = absvalue (o-c) else range = absvalue (h-l);
spacer = averagetruerange(13) /13;
if range = highest(range,BarsBack+1) then begin
   lastbarWRB = true;
   if PlotWRB and  (o-c) < 0 then plot3(l-spacer);
   if PlotWRB and (o-c) >= 0 then plot3(h+spacer);
end;



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Translated by Xaphos © 2007, 2008, 2009 phpBB.fr