TRO INDICATORS FOR MT4

free & uncensored discussion arena for TheRumpledOne

Moderator: moderators

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15544
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Thu Nov 22, 2007 5:43 pm

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.
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 add www.kreslik.com to your ad blocker white list.
Thank you for your support.

alesio
rank: <50 posts
rank: <50 posts
Posts: 27
Joined: Sun Dec 31, 2006 3:01 am
Reputation: 0
Gender: Male
Contact:

Postby alesio » Thu Nov 22, 2007 6:18 pm

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

Skyline
rank: <50 posts
rank: <50 posts
Posts: 39
Joined: Tue Jan 16, 2007 1:27 pm
Reputation: 0
Gender: Male
Contact:

Postby Skyline » Thu Nov 22, 2007 7:17 pm

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 ;)

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15544
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Thu Nov 22, 2007 7:44 pm

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:

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.

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15544
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Thu Nov 22, 2007 7:46 pm

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 add www.kreslik.com to your ad blocker white list.
Thank you for your support.

Skyline
rank: <50 posts
rank: <50 posts
Posts: 39
Joined: Tue Jan 16, 2007 1:27 pm
Reputation: 0
Gender: Male
Contact:

TRO RANGE ACCUMULATOR

Postby Skyline » Thu Nov 22, 2007 10:57 pm

TRO, this is the modified version based on your mt4 attemp.
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);
  }

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15544
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Thu Nov 22, 2007 11:11 pm

Skyline:

Looks good.

Need the value of the current bar to display though.

Thanks.
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.

Skyline
rank: <50 posts
rank: <50 posts
Posts: 39
Joined: Tue Jan 16, 2007 1:27 pm
Reputation: 0
Gender: Male
Contact:

Postby Skyline » Thu Nov 22, 2007 11:28 pm

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

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15544
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Thu Nov 22, 2007 11:56 pm

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.
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.

Skyline
rank: <50 posts
rank: <50 posts
Posts: 39
Joined: Tue Jan 16, 2007 1:27 pm
Reputation: 0
Gender: Male
Contact:

Postby Skyline » Fri Nov 23, 2007 12:02 am

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 :roll:

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.


Return to “TheRumpledOne”