Can you pls add alert and arrow on color change area
And price price action too.
Kindly help sir.
knaimad wrote: Wed Apr 05, 2017 12:09 am learning and excercising with mladen's code (added histogram switch and "multifiltering")
knaimad wrote: Wed Apr 05, 2017 12:09 am learning and excercising with mladen's code (added histogram switch and "multifiltering")
Hi dmnik,
Try....selvakumaran wrote: Tue Oct 03, 2023 12:39 pm Admin sir,
Can you pls add alert and arrow on color change area
And price price action too.
Kindly help sir.
I just saw that Darkdoji thanked me for that post. Actually, my testing of the Fractals Geometry indicator was inspired by Darkdoji's explanations about the financial markets being based on fractals. He said, "The market is not random and therefore not explained by any other alternative view, the market is a chaotic system underpinned by a fractal structure.... a chaotist is a person who applies the precepts of chaos theory and fractal geometry to financial markets".global wrote: Wed Oct 04, 2023 6:30 am Hi dmnik,
I just had a quick look at the code and all I can say is that I just fixed it to show all the dots and fractal lines in the right place in both current and multi timeframe modes. However, to tell you the truth, this indicator proved to be useless to me since it didn't give me an edge in my trading analysis, so I stopped testing it. It does what it does so others may still find it useful. It boils down to what works best for you.
Code: Select all
if(value>1) { theColor = StrongUp; eToolTip="StrongUp"; }
else if(value>0.5) { theColor = MidUp; eToolTip="MidUp"; }
else if(value>0) { theColor = WeakUp; eToolTip="WeakUp"; }
else if(value<-1) { theColor = StrongDown; eToolTip="StrongDown"; }
else if(value<-0.5) { theColor = MidDown; eToolTip="MidDown"; }
else if(value<0) { theColor = WeakDown; eToolTip="WeakDown"; }
Here are more lines of code that show how I evaluated the average fractal directional bias values. Those values were shown as different colors of a histogram so I could see what they were currently, and historically to see how well it worked in the past to predict good trades. Just compile the code below and it should work. Please let me know if you get any errors.global wrote: Wed Oct 04, 2023 9:25 am Below are a few lines of code that shows how I evaluated the average fractal directional bias values. Those values were shown as different colors of a histogram so I could see what they were currently, and historically to see how well it worked in the past to predict good trades.
Code: Select all
#property indicator_separate_window
#property indicator_buffers 7
#property indicator_minimum 0
#property indicator_maximum 1
#property strict
extern string TimeFrames = "M5;M15;M30;H1;H4"; // Time frames to use (separated by ";" in the list)
extern int MaxBars = 500; // Maximum Bars
extern bool UseOrigFormula = false; // Use Original Formula
extern bool UseDpsAvg = true; // Use FG Average
extern color StrongUp = clrAqua; // Color for strong up
extern color MidUp = clrDodgerBlue; // Color for mid up
extern color WeakUp = clrDarkSlateBlue; // Color for weak up
extern color NoMove = clrSilver; // Color for no trend
extern color WeakDown = clrMaroon; // Color for weak down
extern color MidDown = clrFireBrick; // Color for mid down
extern color StrongDown = clrRed; // Color for strong down
extern int HistogramWidth = 3; // Histogram width
double buffer1[], buffer2[], buffer3[], buffer4[], buffer5[], buffer6[], Bias[];
int ctimesLen, aTimes[];
bool returnBars;
string indyFractalGeo="Fractals Geometry v1.4_mt_fix3";
double value;
int OnInit()
{
IndicatorBuffers(7);
SetIndexBuffer(0,buffer1); SetIndexLabel(0,"StrongUp");
SetIndexBuffer(1,buffer2); SetIndexLabel(1,"MidUp");
SetIndexBuffer(2,buffer3); SetIndexLabel(2,"WeakUp");
SetIndexBuffer(3,buffer4); SetIndexLabel(3,"StrongDown");
SetIndexBuffer(4,buffer5); SetIndexLabel(4,"MidDown");
SetIndexBuffer(5,buffer6); SetIndexLabel(5,"WeakDown");
SetIndexBuffer(6,Bias); SetIndexStyle(6,DRAW_NONE); SetIndexLabel(6,"Bias");
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,HistogramWidth,StrongUp);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,HistogramWidth,MidUp);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,HistogramWidth,WeakUp);
SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,HistogramWidth,StrongDown);
SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,HistogramWidth,MidDown);
SetIndexStyle(5,DRAW_HISTOGRAM,STYLE_SOLID,HistogramWidth,WeakDown);
ctimesLen = ArraySize(aTimes);
int s = 0, i = StringFind(TimeFrames,";",s);
while(i > 0)
{
string current = StringSubstr(TimeFrames,s,i-s);
int time = stringToTimeFrame(current);
if(time > 0)
{
ArrayResize(aTimes,ArraySize(aTimes)+1);
aTimes[ArraySize(aTimes)-1] = time;
}
s = i + 1;
i = StringFind(TimeFrames,";",s);
}
IndicatorDigits(Digits);
return(INIT_SUCCEEDED);
}
int start()
{
int counted_bars=IndicatorCounted();
int pos,limit;
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=MathMin(Bars-counted_bars,Bars-1);
if(MaxBars>0 && limit>MaxBars) limit=MaxBars;
if(returnBars) { buffer1[0] = MathMin(limit+1,Bars-1); return(0); }
double sumvalue=0;
double DpsAvg=0;
int ReduceDiv=0;
color theColor = NoMove;
string eToolTip = "NoMove";
for(pos=limit; pos>=0 && !_StopFlag; pos--)
{
for(int t = 0; t < ctimesLen; t++)
{
//+-----------------------------------------------------------------------------------------------------------+
// indyFractalGeo="Fractals Geometry v1.4_mtf_fix3";
// extern ENUM_TIMEFRAMES TimeFrame = PERIOD_CURRENT; // Time frame
// For non-MTF version of Fractals Geometry v1.4
// double value=iCustom(NULL,aTimes[t],indyFractalGeo,5,pos);
// For MTF version of Fractals Geometry v1.4_mtf_fix3
// double value=iCustom(NULL,0,indyFractalGeo,aTimes[t],5,pos);
value=iCustom(NULL,0,indyFractalGeo,aTimes[t],5,pos);
// if(pos==0 && aTimes[t]==240) Comment(value);
if(t==0) { sumvalue=0; DpsAvg=0; ReduceDiv=0; }
if(UseOrigFormula)
{
if(value==1 || value==-1) value=0;
else if(value==2) value=1;
else if(value==-2) value=-1;
}
sumvalue+=value;
if(value==0) ReduceDiv++;
if(t==ArraySize(aTimes)-1)
{
DpsAvg=DivZero(sumvalue,ArraySize(aTimes)-ReduceDiv);
// Display as a colored histogram in the subwindow.
Bias[pos]=DpsAvg;
buffer1[pos] = EMPTY_VALUE; //StrongUp
buffer2[pos] = EMPTY_VALUE; //MidUp
buffer3[pos] = EMPTY_VALUE; //WeakUp
buffer4[pos] = EMPTY_VALUE; //StrongDown
buffer5[pos] = EMPTY_VALUE; //MidDown
buffer6[pos] = EMPTY_VALUE; //WeakDown
if(UseDpsAvg)
{
theColor = NoMove;
eToolTip="NoMove";
if(DpsAvg>1) { buffer1[pos] = 1; theColor = StrongUp; eToolTip="StrongUp"; } // StrongUp;
// else if(DpsAvg==1) { buffer2[pos] = 1; theColor = MidUp; eToolTip="MidUp"; } // MidUp;
else if(DpsAvg>0.5) { buffer2[pos] = 1; theColor = MidUp; eToolTip="MidUp"; } // MidUp;
else if(DpsAvg>0) { buffer3[pos] = 1; theColor = WeakUp; eToolTip="WeakUp"; } // WeakUp;
else if(DpsAvg<-1) { buffer4[pos] = 1; theColor = StrongDown; eToolTip="StrongDown"; } // StrongDown;
// else if(DpsAvg==-1) { buffer5[pos] = 1; theColor = MidDown; eToolTip="MidDown"; } // MidDown;
else if(DpsAvg<-0.5) { buffer5[pos] = 1; theColor = MidDown; eToolTip="MidDown"; } // MidDown;
else if(DpsAvg<0) { buffer6[pos] = 1; theColor = WeakDown; eToolTip="WeakDown"; } // WeakDown;
}
else
{
theColor = NoMove;
eToolTip="NoMove";
if((int)DpsAvg>1) { buffer1[pos] = 1; theColor = StrongUp; eToolTip="StrongUp"; } // StrongUp;
else if((int)DpsAvg==1) { buffer2[pos] = 1; theColor = MidUp; eToolTip="MidUp"; } // MidUp;
else if((int)DpsAvg>0) { buffer3[pos] = 1; theColor = WeakUp; eToolTip="WeakUp"; } // WeakUp;
else if((int)DpsAvg<-1) { buffer4[pos] = 1; theColor = StrongDown; eToolTip="StrongDown"; } // StrongDown;
else if((int)DpsAvg==-1) { buffer5[pos] = 1; theColor = MidDown; eToolTip="MidDown"; } // MidDown;
else if((int)DpsAvg<0) { buffer6[pos] = 1; theColor = WeakDown; eToolTip="WeakDown"; } // WeakDown;
}
} // if(t==ArraySize(aTimes)-1)
} // for(int t = 0; t < ctimesLen; t++)
} //for(pos=limit; pos>=0 && !_StopFlag; pos--)
return(0);
}
//+------------------------------------------------------------------+
//| TimeFrame Functions |
//+------------------------------------------------------------------+
string sTfTable[] = {"M1","M5","M15","M30","H1","H4","D1","W1","MN"};
int iTfTable[] = {1,5,15,30,60,240,1440,10080,43200};
int stringToTimeFrame(string tfs)
{
StringToUpper(tfs);
for(int i=ArraySize(iTfTable)-1; i>=0; i--)
if(tfs==sTfTable[i] || tfs==""+(string)iTfTable[i]) return(iTfTable[i]);
return(_Period);
}
string timeFrameToString(int tf)
{
for(int i=ArraySize(iTfTable)-1; i>=0; i--)
if(tf==iTfTable[i]) return(sTfTable[i]);
return("");
}
//+------------------------------------------------------------------+
//| DivZero: Divides N by D, and returns 0 if the denominator (D) = 0| |
//+------------------------------------------------------------------+
double DivZero(double n,double d)
{
// Usage: double x = DivZero(y,z) sets x = y/z
// Use DivZero(y,z) instead of y/z to eliminate division by zero errors
if(d == 0) return(0); else return(1.0*n/d);
}
I had some free time so I compiled it myself and found two errors. I missed out the f from mtf, in the name of the indicator called by iCustom, plus I put the lineglobal wrote: Wed Oct 04, 2023 11:42 am Here are more lines of code that show how I evaluated the average fractal directional bias values. Those values were shown as different colors of a histogram so I could see what they were currently, and historically to see how well it worked in the past to predict good trades. Just compile the code below and it should work. Please let me know if you get any errors.
Code: Select all
ctimesLen = ArraySize(aTimes);
Exactly brother,
Interesting to watch - will this go up or down?
Hello Jimmy,Jimmy wrote: Wed Oct 09, 2019 5:05 pm Good question Preethi. Multi Time Frame indicators are beneficial because:
- They allow you to display the higher timeframe's indicator information in lower timeframes (of course).
- Using an MTF indicator on a lower timeframe allows you to pin-point your entries to trade into the "bigger" trend, on the lower timeframe.
- They help traders see higher timeframe information at a glance.
- Multi time frame indicators allow smaller timeframe traders a look at the overall market sentiment, instead of being "locked" into the view of the lower timeframe.
Example:
One of my favorite ways to use MTF analysis is with the TDI Indicator and the Floating Indicator's MTF function.
In the chart below, you would take the 5 Minute chart's TDI trades into the 4 hour TDI's signal by using the Floating Indicator and MTF.
In the floating indicator's settings, I've set the MTF to the 4 hour timeframe.
When the Floating Indicator's 4 hour TDI crosses on a "strong angle", I won't enter immediately. I'll now watch this 5 minute chart's TDI (in my subwindow) and wait until the 5 minute chart's TDI crosses into the same direction of the Floating Indicator's 4 hour TDI's cross, then I will take the trade into the 4 hour TDI's signal.
By doing this, you will reduce drawdown and you'll be able to enter trades with precision and without switching charts too often.
This same technique applies to all MTF indicators and is also a technique that XARD teaches for using his Simple Trend Following System
To sum it all up, a Multi Time Frame indicator's purpose is to allow a smaller timeframe trader to see what the larger timeframe's indicators are doing. And this reduces the need for switching charts and can be beneficial for beginners as nearly all the information needed can be shown on one screen![]()