Does MT4 allow you to have inputs like ( high - low ) ?
I was trying to build a TRO RANGE indicator for MT4... haven't succeeded yet.
TRO INDICATORS FOR MT4
Moderator: moderators
- TheRumpledOne
- rank: 10000+ posts
- Posts: 15561
- Joined: Sun May 14, 2006 9:31 pm
- Reputation: 3035
- Location: Oregon
- Real name: Avery T. Horton, Jr.
- Gender:
- Contact:
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
anyone got any info on how to read this accumulator indicator. i gave up my tradestation account a long time ago so have forgotten how most indicators work, now i just use MT4. i would love to give some feed back on this indicator and any others u put up. but just need a little help in using them.
thanx
thanx
TheRumpledOne wrote:Does MT4 allow you to have inputs like ( high - low ) ?
I was trying to build a TRO RANGE indicator for MT4... haven't succeeded yet.
You can define whatever input you like that could be used within the indicator.
Btw if you could explain me what TRO RANGE should do, I can give a try
- TheRumpledOne
- rank: 10000+ posts
- Posts: 15561
- Joined: Sun May 14, 2006 9:31 pm
- Reputation: 3035
- Location: Oregon
- Real name: Avery T. Horton, Jr.
- Gender:
- Contact:
TRO Range should plot a histogram of the range ( high - low ) of the candle. If the THRESHOLD is met or exceeded the histogram bar should be a different color.
My attempt:
My attempt:
Code: Select all
//+------------------------------------------------------------------+
//| TRO RANGE Accumulator.mq4 |
//| TRO, 2007 |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright ? 2007, Avery T. Horton, Jr. aka TRO"
#property link "http://www.therumpldone.com/"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Silver
#property indicator_color2 Red
#property indicator_width1 2
//---- indicator buffers
double RANGEBuffer[];
double ThresholdBuffer[];
//---- indicator parameters
extern int Threshold=20;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- drawing settings
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexStyle(1,DRAW_LINE);
SetIndexDrawBegin(1,Threshold);
IndicatorDigits(Digits+1);
//---- indicator buffers mapping
SetIndexBuffer(0,RANGEBuffer);
SetIndexBuffer(1,ThresholdBuffer);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("RANGE");
SetIndexLabel(0,"RANGE");
SetIndexLabel(1,"THRESHOLD");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Range |
//+------------------------------------------------------------------+
int start()
{
double HighVal,LowVal;
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
// if(counted_bars>0) counted_bars--;
// limit=Bars-counted_bars;
//---- RANGE counted in the 1-st buffer
// for(int i=0; i<limit; i++)
HighVal = iHigh(NULL,0,counted_bars);
LowVal = iLow(NULL,0,counted_bars);
RANGEBuffer[counted_bars] = (HighVal-LowVal)*100;
//---- Threshold line counted in the 2-nd buffer
// for(i=0; i<limit; i++)
ThresholdBuffer[counted_bars]=Threshold;
//---- done
return(0);
}
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!
Please do NOT PM me with trading or coding questions, post them in a thread.
Please do NOT PM me with trading or coding questions, post them in a thread.
- TheRumpledOne
- rank: 10000+ posts
- Posts: 15561
- Joined: Sun May 14, 2006 9:31 pm
- Reputation: 3035
- Location: Oregon
- Real name: Avery T. Horton, Jr.
- Gender:
- Contact:
alesio wrote:anyone got any info on how to read this accumulator indicator. i gave up my tradestation account a long time ago so have forgotten how most indicators work, now i just use MT4. i would love to give some feed back on this indicator and any others u put up. but just need a little help in using them.
thanx
TRO PLOT ACCUMULATOR displays how many times an event happened.
The examples show how many times the price went up 0 - 1%, 1 - 2%, 2 - 3%, etc...
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!
Please do NOT PM me with trading or coding questions, post them in a thread.
Please do NOT PM me with trading or coding questions, post them in a thread.
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
TRO RANGE ACCUMULATOR
TRO, this is the modified version based on your mt4 attemp.
Let me know if this match your request
Let me know if this match your request
Code: Select all
//+-------------------------------------------------------------------+
//| TRO RANGE Accumulator.mq4 |
//| TRO, 2007 |
//| modified by Skyline on 22 Nov 2007 |
//+-------------------------------------------------------------------+
#property copyright "Copyright ? 2007, Avery T. Horton, Jr. aka TRO"
#property link "http://www.therumpldone.com/"
//---- indicator settings
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_color3 Black
#property indicator_width3 2
//---- indicator buffers
double RANGEBuffer[];
double RANGEBuffer1[];
double ThresholdBuffer[];
//---- indicator parameters
extern int Threshold=20;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- drawing settings
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2);
SetIndexStyle(2,DRAW_LINE);
//---- indicator buffers mapping
SetIndexBuffer(0,RANGEBuffer);
SetIndexBuffer(1,RANGEBuffer1);
SetIndexBuffer(2,ThresholdBuffer);
//---- name for DataWindow and indicator subwindow label
IndicatorShortName("RANGE");
SetIndexLabel(0,"RANGE");
SetIndexLabel(1,"RANGE");
SetIndexLabel(2,"THRESHOLD");
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Range |
//+------------------------------------------------------------------+
int start()
{
double HighVal,LowVal;
int limit;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- RANGE counted in the 1-st buffer
for(int i=0; i<limit; i++)
{
HighVal = iHigh(NULL,0,i);
LowVal = iLow(NULL,0,i);
if ((HighVal-LowVal)/Point > Threshold) { RANGEBuffer1[i] = (HighVal-LowVal)/Point;}
else { RANGEBuffer[i] = (HighVal-LowVal)/Point; }
ThresholdBuffer[i]=Threshold;
}
//---- done
return(0);
}
- TheRumpledOne
- rank: 10000+ posts
- Posts: 15561
- Joined: Sun May 14, 2006 9:31 pm
- Reputation: 3035
- Location: Oregon
- Real name: Avery T. Horton, Jr.
- Gender:
- Contact:
TheRumpledOne wrote:Skyline:
Looks good.
Need the value of the current bar to display though.
Thanks.
You're welcome TRO
To show current bar value you have to move mouse pointer over the bar and read the value displayed on popup message.
Btw I'm curious on how it's supposed to be used this indicator in normal trading. Could you give some insight about ?
thx
Skyline
- TheRumpledOne
- rank: 10000+ posts
- Posts: 15561
- Joined: Sun May 14, 2006 9:31 pm
- Reputation: 3035
- Location: Oregon
- Real name: Avery T. Horton, Jr.
- Gender:
- Contact:
Skyline:
Shouldn't have to move the mouse to see the current value!
How do you use this inidicator?
This indicator is displaying the range of the current bar. If you now the average range for the interval, then you can decide if there is more gas in the tank.
For example, the USDJPY 60 minute average over the last 960 bars is 21 pips. So you know that the price has to range and you can take advantage of this.
If you look at the 24 hour display I posted a while ago, you'll see just how much it ranges per hour for each hour.
What you coded is the chart version.
Notice the all the green histogram bars - the USDJPY was ranging like it normally does. Then the holiday hit and the bars are red. Can't be as greedy.
Since the price usually ranges, when it goes one way 4 or 5 pips, stops and reverses, you can guess it will run 20 or more pips in the opposite direction to give the 20+ pip range.
Shouldn't have to move the mouse to see the current value!
How do you use this inidicator?
This indicator is displaying the range of the current bar. If you now the average range for the interval, then you can decide if there is more gas in the tank.
For example, the USDJPY 60 minute average over the last 960 bars is 21 pips. So you know that the price has to range and you can take advantage of this.
If you look at the 24 hour display I posted a while ago, you'll see just how much it ranges per hour for each hour.
What you coded is the chart version.
Notice the all the green histogram bars - the USDJPY was ranging like it normally does. Then the holiday hit and the bars are red. Can't be as greedy.
Since the price usually ranges, when it goes one way 4 or 5 pips, stops and reverses, you can guess it will run 20 or more pips in the opposite direction to give the 20+ pip range.
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!
Please do NOT PM me with trading or coding questions, post them in a thread.
Please do NOT PM me with trading or coding questions, post them in a thread.
TheRumpledOne wrote:Skyline:
Shouldn't have to move the mouse to see the current value!
How do you use this inidicator?
This indicator is displaying the range of the current bar. If you now the average range for the interval, then you can decide if there is more gas in the tank.
For example, the USDJPY 60 minute average over the last 960 bars is 21 pips. So you know that the price has to range and you can take advantage of this.
If you look at the 24 hour display I posted a while ago, you'll see just how much it ranges per hour for each hour.
What you coded is the chart version.
I know TRO but I never see value on top of histogram bar on mt4 indicator , I'm sorry
Thx for explanation it seems really interesting this indicator !
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.