Welcome to the Traders Laboratory.

Trading Indicators Share, download, and discuss trading indicators.

Reply
Sliding Range Details »»
Sliding Range
Platform: , by derek2209 derek2209 is offline
Developer Last Online: Dec 2017 Show Printable Version Email this Page

Platform: Unknown Rating:
Released: 11-24-2016 Last Update: Never Installs: 0
 
No support by the author.

Hello,

Would anyone be kind enough the convert the mq4 formula for the
Sling Range into tradestation Code
Hoping that you can oblige
Thank you in advance
Derek

Code:
//+------------------------------------------------------------------+
//|                                              Rj_SlidingRange.mq4 |
//|                            Copyright © 2011,RJ Rjabkov Alexander |
//|                                                     rj-a@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011,RJ Rjabkov Alexander"
#property link      "rj-a@mail.ru"

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Aqua
#property indicator_color2 Red
#property indicator_color3 Aqua
#property indicator_color4 Red
#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 2
#property indicator_width4 2
#property indicator_style1 2
#property indicator_style2 2

extern int CalcPeriodRange  = 5;

double UpperLimit[];
double LowerLimit[];
double AwlUpper[];
double AwlLower[];
double Current[];

int init() {
  IndicatorBuffers(5);
  SetIndexBuffer(0, UpperLimit);
  SetIndexBuffer(1, LowerLimit);
  SetIndexBuffer(2, AwlUpper);
  SetIndexBuffer(3, AwlLower);
  SetIndexBuffer(4, Current);
  SetIndexStyle(0, DRAW_LINE);
  SetIndexStyle(1, DRAW_LINE);
  SetIndexStyle(2, DRAW_LINE);
  SetIndexStyle(3, DRAW_LINE);
  return(0);
}

int deinit() {return(0);}

int start() {
  int i, cb;
  int counted_bars = IndicatorCounted();
  if (counted_bars < 0) return(-1); 
  if (counted_bars > 0) counted_bars--;
  cb=Bars-counted_bars;

  while(cb>=0) {
    i=cb+CalcPeriodRange-1;
    double b1=0, b2=0;
    while(i>=cb) {
      b1 += High[iHighest(NULL, 0, MODE_HIGH, CalcPeriodRange, i)];
      b2 += Low[iLowest(NULL, 0, MODE_LOW, CalcPeriodRange, i)];
      i--;
    }
    UpperLimit[cb]=b1/CalcPeriodRange;
    LowerLimit[cb]=b2/CalcPeriodRange;
    Current[cb]=NormalizeDouble((UpperLimit[cb]+LowerLimit[cb])/2, 5);
    AwlUpper[cb]=EMPTY_VALUE;
    AwlLower[cb]=EMPTY_VALUE;
    if(Current[cb]>Current[cb+1]) {AwlUpper[cb]=Current[cb]; AwlUpper[cb+1]=Current[cb+1];}
    if(Current[cb]<Current[cb+1]) {AwlLower[cb]=Current[cb]; AwlLower[cb+1]=Current[cb+1];}
    if(Current[cb]==Current[cb+1] && AwlLower[cb+1]!=EMPTY_VALUE) {AwlLower[cb]=Current[cb];}
    if(Current[cb]==Current[cb+1] && AwlUpper[cb+1]!=EMPTY_VALUE) {AwlUpper[cb]=Current[cb];}
    cb--;
  }
  return(0);
}
//+------------------------------------------------------------------+

Show Your Support

  • If you like to thanks you by the author -> Click Thanks to the Author
  • This modification may not be copied, reproduced or published elsewhere without the author's permission.

Comments
Old 11-24-2016, 08:13 AM   #2

Join Date: Jul 2014
Posts: 32
Ignore this user

Thanks: 2
Thanked 1 Time in 1 Post

Re: Sliding Range

Hello

Below is a Link for a screensot of the Sliding Range Indicator:
Derek

????????? Rj_SlidingRange ?? ?????? ??????
derek2209 is offline  
Reply With Quote
Old 12-01-2016, 05:31 PM   #3

Join Date: Jul 2014
Posts: 32
Ignore this user

Thanks: 2
Thanked 1 Time in 1 Post

Re: Sliding Range

Hi

Code:
Inputs:
	Period(5);

vars:
	MidLine(0),UpperBand(0),LowerBand(0);

UpperBand=Average(Highest(High,Period),Period);
LowerBand=Average(Lowest(Low,Period),Period);
MidLine=(UpperBand+LowerBand)/2;

Plot1(MidLine,"MidLine");
if MidLine >= MidLine[1] then setplotcolor(1,Cyan) else setplotcolor(1,red);

Plot2(UpperBand,"UpperBand",LightGray);
Plot3(LowerBand,"LowerBand",DarkGray);
Derek
derek2209 is offline  
Reply With Quote
Old 04-30-2017, 01:02 PM   #4

Join Date: Aug 2011
Posts: 119
Ignore this user

Thanks: 128
Thanked 33 Times in 28 Posts

Re: Sliding Range

It's a junk indicator Derek ! Your better off using the vma rainbow.
http://www.traderslaboratory.com/for...-research.html
johnnydaymon is offline  
Reply With Quote
Old 11-25-2017, 08:04 AM   #5

Join Date: Oct 2013
Posts: 165
Ignore this user

Thanks: 0
Thanked 1 Time in 1 Post

Re: Sliding Range

Look and works like junk tried on my hotforex platform and once again got a proof that there is no better than simple but effective price action.
fxeconomist is offline  
Reply With Quote
Old 12-21-2017, 11:27 AM   #6
zdo

Join Date: Nov 2007
Location: boonies
Posts: 2,886
Ignore this user

Thanks: 424
Thanked 580 Times in 440 Posts

Re: Sliding Range

Quote:
Originally Posted by fxeconomist »
Look and works like junk tried on my hotforex platform and once again got a proof that there is no better than simple but effective price action.
Some end of year thoughts on trading using priceseries *

Consciously, ‘PAv’ traders are categorically NOT able to trade with oscillators (/ indicators). (Note that ‘consciously’ part - because unconsciously every single one of them is creating and using ‘indicators’ in the background.)

Real oscillators traders can categorically NOT (consciously) trade with PA. (Note that ‘consciously’ part - because unconsciously every single one of them is attempting to process PA on the fly.)

Point is - Both modes are always going / functioning.

“Find your own way” zdo. Find out which one you are best suited for, make that one dominant and develop it that fully... Let the other one be recessive.

If you’re a PA trader, don’t fool yourself into total rejection of oscillators. And by the same token, if you’re an oscillators trader, don’t be swayed by the preaching of PA traders to completely exclude oscillators trading. Find out which one you are best suited for, develop that fully... and then you might be free to consciously include and accommodate certain aspects from the other one.

...

PA traders do notice and repeatedly announce an important ‘weakness’ of indicators. Stock indicators don’t ‘work’.
Yep, statistically out the box at best they produce ( with ‘costs, a slightly negative) wash... ie the ‘sample runs’ where they outperform do not offset the ‘sample runs’ where they underperform, etc. **
...

The key word here is “stock”.

There are (only?) three ways to overcome this weakness of stock indicators.
1 ‘Skew’ the indicator calculations to match the ‘slope’ (and travel, etc) of the auctions.
2 Learn to ‘wetware skew’ the reading of the indicator to match the ‘slope’ (etc) of the auctions.
3 Type the auctions to know when and when NOT to apply an indicator

ie You got to know when and how to "harm squiggly lines" (sorry TRO for appropriating your apt phrase... )


Wishing all ya'll wonderful holidays and a happy solstice in exactly one minute !!!!


zdo



*instead of non price / fundamental / narrative information

** Unfortunately, PA traders can't go about as readily acknowledging the equivalent real world statistics of 'out the box' PA... ie don't get it that both modes are always going / functioning.
zdo is offline  
Reply With Quote
Old 01-10-2018, 04:57 PM   #7

Join Date: Oct 2013
Posts: 165
Ignore this user

Thanks: 0
Thanked 1 Time in 1 Post

Re: Sliding Range

Thanks for input and yes every trader should find something that works exclusively for him, trading is about a battle where know-how's try to outperform each other.
fxeconomist is offline  
Reply With Quote

Reply

Thread Tools
Help Others By Rating This Thread
Help Others By Rating This Thread:

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adaptive Range Bar Kingsley Anderson Coding Forum 1 07-06-2011 09:25 PM
SST Range Bars jaturner Ultimate Trade Analyzer 11 10-14-2010 11:42 PM
SPY Opening Range Volume Vs Days Range darthtrader Technical Analysis 3 04-17-2008 11:54 AM
Range Trading bronxterp Technical Analysis 10 12-03-2007 08:23 AM
How to estimate the range TinGull Market Profile 0 01-03-2007 04:35 PM

All times are GMT -4. The time now is 03:52 PM.
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
CS to VB integration by DeskLancer
©2006-2011 Traders Laboratory, All Rights Reserved.