TRO INDICATORS FOR MT4

free & uncensored discussion arena for TheRumpledOne

Moderator: moderators

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

TRO DYNAMIC PLOT ACCUMULATOR MT4

Postby Skyline » Fri Nov 23, 2007 10:54 am

TRO DYNAMIC PLOT ACCUMULATOR for MT4

Added a simple moving average with an external parameters to set period lenght (MA_Period), that will be showed on the histogram so there's no more need to change manually the Threshold line. Infact the histogram will change its color whenever the bar is above (green) or below (red) its mov avg. value, so now we get a dynamic plot accumulator :)

Hope you like it ;)

Image

Code: Select all

//+-------------------------------------------------------------------+
//|                                          TRO PLOT Accumulator.mq4 |
//|                                                         TRO, 2007 |
//|                                modified by Skyline on 23 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 4
#property  indicator_color1  Red
#property  indicator_color2  Green
#property  indicator_color3  Orange

//---- indicator buffers
double     RANGEBuffer[];
double     RANGEBuffer1[];
double     RANGEBuffer2[];
double     TempBuffer[];

//---- indicator parameters 
//extern int   Threshold       = 20;
extern color CurrentBarColor = Yellow;
extern color ThresholdColor  = Aqua;
extern bool  ShowLabel       = false;
extern int   MA_Period       = 200;

//+------------------------------------------------------------------+
//| 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,STYLE_SOLID,2);
   SetIndexStyle(3,DRAW_NONE);   

//---- indicator buffers mapping

   SetIndexBuffer(0,RANGEBuffer);
   SetIndexBuffer(1,RANGEBuffer1); 
   SetIndexBuffer(2,RANGEBuffer2);
   SetIndexBuffer(3,TempBuffer); // non visualizzato
   
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("TRO PLOT ACCUMULATOR");
   SetIndexLabel(0,"TRO ABOVE");
   SetIndexLabel(1,"TRO BELOW");
   SetIndexLabel(2,"TRO MOVING AVERAGE");
   
//---- initialization done
   return(0);
  }

int deinit()
{
   ObjectDelete("CurrentBarValue");
   ObjectDelete("LabelCurrentBarValue"); 
   ObjectDelete("Threshold");


//+------------------------------------------------------------------+
//| Range                                                            |
//+------------------------------------------------------------------+
int start()
  {

   double HighVal,LowVal;
   int limit;
   int counted_bars=IndicatorCounted();
   
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   if(counted_bars<0) return(-1);
   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);
     
     TempBuffer[i] = (HighVal-LowVal)/Point;
 
     /*
     // Draw Threshold line 
     ObjectDelete("Threshold");
     ObjectCreate("Threshold", OBJ_HLINE, win_idx, Time[0], Threshold);
     ObjectSet("Threshold", OBJPROP_COLOR, ThresholdColor);
     ObjectSet("Threshold", OBJPROP_STYLE, STYLE_SOLID);
     ObjectSet("Threshold", OBJPROP_WIDTH, 1);
     ObjectSet("Threshold", OBJPROP_BACK, true);
     
     // Label for Threshold
     if ( ShowLabel == true)
     {
      ObjectDelete("LabelThreshold");
      ObjectCreate("LabelThreshold", OBJ_TEXT, win_idx, Time[0], Threshold);
      ObjectSet("LabelThreshold", OBJPROP_COLOR, ThresholdColor);
      ObjectSetText("LabelThreshold", "Threshold",8);
      ObjectSet("LabelThreshold", OBJPROP_ANGLE, 0);
     }
     */
   }

   // Calculate MA of Histograms
   for(int j=0; j<limit; j++)
   {
     RANGEBuffer2[j]  = iMAOnArray(TempBuffer,0,MA_Period,0,MODE_SMA,j);
   }
   
   // Paint Histograms
   for ( i=0; i<limit; i++)
   {
    if ( TempBuffer[i] >= RANGEBuffer2[i]) { RANGEBuffer1[i] = TempBuffer[i]; }
    else { RANGEBuffer[i] = TempBuffer[i]; }   
   } 
   
   // Draw Current Bar line value
   int win_idx=WindowFind("TRO PLOT ACCUMULATOR");
   ObjectDelete("CurrentBarValue");
   ObjectCreate("CurrentBarValue", OBJ_HLINE, win_idx, Time[0], (iHigh(NULL,0,0)-iLow(NULL,0,0))/Point);
   ObjectSet("CurrentBarValue", OBJPROP_COLOR, CurrentBarColor);
   ObjectSet("CurrentBarValue", OBJPROP_STYLE, STYLE_SOLID);
   ObjectSet("CurrentBarValue", OBJPROP_WIDTH, 1);
   ObjectSet("CurrentBarValue", OBJPROP_BACK, true);
     
   // Label per Current Bar Line
   if ( ShowLabel == true )
   {
     ObjectDelete("LabelCurrentBarValue");
     ObjectCreate("LabelCurrentBarValue", OBJ_TEXT, win_idx, Time[0], (iHigh(NULL,0,0)-iLow(NULL,0,0))/Point);
     ObjectSet("LabelCurrentBarValue", OBJPROP_COLOR, CurrentBarColor);
     ObjectSetText("LabelCurrentBarValue", "Current Bar value",8);
     ObjectSet("LabelCurrentBarValue", OBJPROP_ANGLE, 0);     
   }   
//---- done
   return(0);
  }

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

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

Postby TheRumpledOne » Fri Nov 23, 2007 4:15 pm

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 » Sun Nov 25, 2007 5:09 pm

You're welcome TRO ;)
Let me know if you want to code something else for mt4 and I can give a try :)

Skyline

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

Postby TheRumpledOne » Sun Nov 25, 2007 5:24 pm

I need TRO DYNAMIC FIBS SR coded.
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.

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

Postby alesio » Sun Nov 25, 2007 6:23 pm

nice work skyline. do u think we could have the MQL4 file to download. im just not too good at inputting all this code.

thanx

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:

Postby Skyline » Sun Nov 25, 2007 6:50 pm

TheRumpledOne wrote:I need TRO DYNAMIC FIBS SR coded.


Ok i'll try to code it, could you explain what is supposed to do this indicator ?

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

Postby Skyline » Sun Nov 25, 2007 6:52 pm

alesio wrote:nice work skyline. do u think we could have the MQL4 file to download. im just not too good at inputting all this code.

thanx


You're welcome Alesio ;)
In attachment you'll find the mql4 version ;)
Attachments
TRO Dynamic Plot Accumulator.zip
(4.56 KiB) Downloaded 773 times

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

Postby alesio » Sun Nov 25, 2007 7:11 pm

thanx skyline. would u mind if i asked u to convert some ts indicators to mt4.

deeforex
rank: 50+ posts
rank: 50+ posts
Posts: 99
Joined: Tue Oct 31, 2006 5:46 pm
Reputation: 0
Gender: None specified

Postby deeforex » Tue Jan 15, 2008 10:46 pm

Hi TRO & Skyline,

In this thread I see the $Trillion Strategy Indicator on one of TRO's charts. Has that Indie been released? If it has, could you please post the link or possibly repost it?

I'm still doing a search through the forum to see if I can find it. No luck so far but I'll continue looking.

TIA,
dee

EDIT: found it! search for '$trillion and mt4' did not work. the magic words were 'trillion and mt4'

Here's the link...

http://kreslik.com/forums/viewtopic.php ... n+mt4#4282

tools
rank: <50 posts
rank: <50 posts
Posts: 2
Joined: Sun Jan 06, 2008 2:16 am
Reputation: 0
Gender: None specified

Tro Range

Postby tools » Thu Feb 21, 2008 2:10 am

Hi Tro and Skyline,

Not sure if you all have all ready done this or not but made the threshold automatic, looking back 65 bars to determine avg. threshold.

tools
Attachments
_TRO_RANGE[auto3].mq4
(9.71 KiB) Downloaded 665 times

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “TheRumpledOne”