Sliding Range
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
//+------------------------------------------------------------------+
//| Rj_SlidingRange.mq4 |
//| Copyright © 2011,RJ Rjabkov Alexander |
//| [email protected] |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011,RJ Rjabkov Alexander"
#property link "[email protected]"
#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 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] 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);
}
//+------------------------------------------------------------------+
Source: http://www.traderslaboratory.com/forums/trading-indicators/20546-sliding-range.html
Anyone can join.
Anyone can contribute.
Anyone can become informed about their world.
"United We Stand" Click Here To Create Your Personal Citizen Journalist Account Today, Be Sure To Invite Your Friends.
Lion’s Mane Mushroom
Mushrooms are having a moment. One fabulous fungus in particular, lion’s mane, may help improve memory, depression and anxiety symptoms. They are also an excellent source of nutrients that show promise as a therapy for dementia, and other neurodegenerative diseases. If you’re living with anxiety or depression, you may be curious about all the therapy options out there — including the natural ones.Our Lion’s Mane WHOLE MIND Nootropic Blend has been formulated to utilize the potency of Lion’s mane but also include the benefits of four other Highly Beneficial Mushrooms. Synergistically, they work together to Build your health through improving cognitive function and immunity regardless of your age. Our Nootropic not only improves your Cognitive Function and Activates your Immune System, But it benefits growth of Essential Gut Flora, further enhancing your Vitality.
Our Formula includes:
Lion’s Mane Mushrooms which Increase Brain Power through nerve growth, lessen anxiety, reduce depression, and improve concentration. Its an excellent adaptogen, promotes sleep and improves immunity.
Shiitake Mushrooms which Fight cancer cells and infectious disease, boost the immune system, promotes brain function, and serves as a source of B vitamins.
Maitake Mushrooms which regulate blood sugar levels of diabetics, reduce hypertension and boosts the immune system.
Reishi Mushrooms which Fight inflammation, liver disease, fatigue, tumor growth and cancer. They Improve skin disorders and soothes digestive problems, stomach ulcers and leaky gut syndrome.
Chaga Mushrooms which have anti-aging effects, boost immune function, improve stamina and athletic performance, even act as a natural aphrodisiac, fighting diabetes and improving liver function.
Try Our Lion’s Mane WHOLE MIND Nootropic Blend 60 Capsules. Today Be 100% Satisfied Or Receive A Full Money Back Guarantee Order Yours Today By Following This Link.