|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Convert this into MT3 for me PLEASE
Hi all,
I'm beginning to not trust my broker's MT4 feed. I'd like to compare this indicator in MT3's charting vs. the MT4. It's very, very simple - can anyone convert it for me? It's VERY good for determining when breakouts are about to occur. Thank you! SB Code:
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Aqua
#property indicator_color2 Aqua
//#property indicator_width1 5
//#property indicator_width2 5
extern int period = 8;
double vftop[];
double vfbot[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(2);
SetIndexBuffer(0, vfbot);
SetIndexStyle(0, DRAW_ARROW);
SetIndexArrow(0, 117);
SetIndexEmptyValue(0, 0);
SetIndexBuffer(1, vftop);
SetIndexStyle(1, DRAW_ARROW);
SetIndexArrow(1, 117);
SetIndexEmptyValue(1, 0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i = Bars - counted_bars;
if(counted_bars == 0) i = Bars - period*2;
int j = 0;
double t1, t2;
while(i >= 0)
{
t1 = Low[i];
t2 = High[i];
for(j = i+1; j < i + period; j++)
{
t1 = MathMax(t1, Low[j]);
t2 = MathMin(t2, High[j]);
}
if(t1 <= t2)
{
vftop[i] = t2;
vfbot[i] = t1;
}
i--;
}
//----
return(0);
}
//+------------------------------------------------------------------+
|
|
|||
|
Quote:
often times it will fire off a nice line of plots and then the market will run up, pause, and reverse right back through that level to make the new real trend. so beware of this when using it. you have to view that level as an area where many positions have been taken, but it isn't always indicative of direction. |
|
|||
|
Hi scott, programming in old MT3 language isn't so easy if you haven't done it for long time.
But perhaps there is another possibility to check if your broker is worth your mistrust. When Im right your indicator simply draws arrows to any bar where the highest Low of the previous 8(=periodNumber) bars is equal or lower than the lowest High of this period. So if you have got a bar of mistrust look at the previous 8 bars. If they are different in MT3 from MT4 you might have reason for mistrust. Regards Martin ---- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help for convert from VT to MQL4 | M-E-C | Expert Advisors - Metatrader 4 | 11 | 07-27-2007 06:53 PM |
| EA convert Help | Alex.Piech.FinGeR | Expert Advisors - Metatrader 4 | 2 | 12-21-2005 12:32 PM |