You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
There's a turkey like this
//+------------------------------------------------------------------+
//| Tick_on_Chart.mq4 |
//| Copyright © 2005, MetaQuotes Software Corp.
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Cornsilk
#property indicator_color2 Red
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
int tik,t;
double buf[];MaxB,MinB=1000;
extern int period=200;
//+------------------------------------------------------------------+
//| Custom indicator initialisation function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_SECTION);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_NONE);
SetIndexBuffer(1,ExtMapBuffer2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i,b;
//----
t++;
b=period;
ArrayResize(buf,b);
if(tik==0)
{
for(i=0;i<b;i++)
{
buf[i]=Bid;
}
ExtMapBuffer2[0]=Bid+5*Point;
ExtMapBuffer2[1]=Bid-5*Point;
tik=1;
}
MaxB=0;MinB=1000;
for(i=b-1;i>0;i--)
{
buf[i]=buf[i-1];
if(MaxB<buf[i])MaxB=buf[i];
if(MinB>buf[i])MinB=buf[i];
}
buf[0]=Bid;
for(i=0;i<b;i++)
{
ExtMapBuffer1[i]=buf[i];
}
if(MathCeil(t/10)*10==t)
{
for(i=b;i<Bars;i++)
{
ExtMapBuffer1[i]=Bid;
}
ArrayInitialize(ExtMapBuffer2,Bid);
if(MaxB-Bid<5*Point)ExtMapBuffer2[0]=Bid+5*Point;
if(Bid-MinB<5*Point)ExtMapBuffer2[1]=Bid-5*Point;
//Print(MaxB, "+",Bid, "+",MinB);
}
//----
return(0);
}
//+------------------------------------------------------------------+
On its basis we make CCI... the same tick...
Commodity Channel Index
ORIGINAL
Calculation
Find a typical price. To do it, add high, low and close price of each bar and divide the sum by 3.
TP = (HIGH + LOW + CLOSE) / 3
Calculate an n-period simple moving average of typical prices.
SMA (TP, N) = SUM (TP, N) / N
Subtract the resulting SMA(TP, N) from the typical TP prices of each of the preceding n periods.
D = TP - SMA(TP, N)
4. Calculate the n-period simple moving average of the absolute values of D
SMA (D, N) = SUM (D, N) / N
5) Multiply SMA (D, N) by 0.015
M = SMA (D, N) * 0.015
6. divide M by D
CCI = M / D
where:
HIGH - maximum price of the bar;
LOW - minimum price of the bar;
CLOSE - closing price;
SMA - simple moving average;
SUM - sum;
N - number of periods used for the calculation.
Namely... point by point... what is to be done
1) Find a typical price. To do this add up the high, low and closing price of each bar and divide the sum by 3.
TP = (HIGH + LOW + CLOSE) / 3
Since there is no HIGH and LOW on ticks, we simply take the value of the price on the tick
2) Calculate an n-period simple moving average
SMA (TP, N) = SUM (TP, N) / N
Calculate the n-period simple moving average of prices from #1
3) Subtract the resulting SMA(TP, N) from the typical TP prices of each of the preceding n periods.
D = TP - SMA(TP, N)
Subtract the resulting SMA (#2) from (#1) of each of the preceding n periods.
4) Calculate the n-period simple moving average of absolute values D
SMA (D, N) = SUM (D, N) / N
This is how we do it.
5) Multiply obtained SMA (D, N) by 0.015
M = SMA (D, N) * 0.015
This is how we do it...
6) Divide M by D
CCI = M / D
This is how we do it...
NOW IN PURPOSE ... drawing of ToR (I hope I described it clearly above)...
Drawing the inductor ALL the above described ....
ADDIONS...
In the settings of the indicator (INPUT PARAMETERS)... make these adjustable parameters... (I will indicate the additions with explanations)
1) Specify the CCI period (everything is clear here)
Specify "Period CCI" in the settings.
2) Specify the value (0.015) with the possibility of changing it ... (it doesn't affect anything in particular - but for convenience ...)
In settings specify "Znach".
3) Let's make "Alerts" ...
ALL "Alerts" with possibility to enable (True) and disable (False)
ALL "Alerts" with possibility of sound signal (configurable - so it can be on/off)
3.1) INDJUNCTION = 0 (level = NULL)
Set to "Uroven0".
3.2) Intersection of all INDUCLE values = any Setpoint... (level)
For example (level = 100) or (level = -35) with a POSSIBLE ability to change... (level)... to produce a signal...
INSTALLED FOR values in + and values in -
with possibility of switching them ON (True) and OFF (False) ALWAYS
At the settings it is set as "Uroven+".
In the settings indicate "Uroven-".
FURTHER... In the settings of the indicator (COLORS) = make it possible to change colours,
any of parameters.
now we want to get proper (graphic) view of the given indicator
EXAMPLE in Fig.(then explanations)...
1) Divide each new minute with a vertical line (red in the picture)
2) Print the time in hour:min. At the opening of the current BAR (or the current CURRENT).
So if there was a missed minute, instead of 07:06 it will be 07:09 for example.
NOW the desired additions ...(if possible)
1) (first and last... )))))))) possibility of setting MA by already received values... (see fig.) I hope everything is clear...
And again with the possibility of choosing...
1.1) PERIOD of a given MA
1.2) colour of the given MA
1.3) and the "Alerts" setup by the intersection of level=0 of this MA
1.4) as well as for МА crossing levels (for example +200 and -50) separately
There's a turkey like this
//+------------------------------------------------------------------+
//| Tick_on_Chart.mq4 |
//| Copyright © 2005, MetaQuotes Software Corp.
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Cornsilk
#property indicator_color2 Red
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
int tik,t;
double buf[];MaxB,MinB=1000;
extern int period=200;
//+------------------------------------------------------------------+
//| Custom indicator initialisation function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_SECTION);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_NONE);
SetIndexBuffer(1,ExtMapBuffer2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i,b;
//----
t++;
b=period;
ArrayResize(buf,b);
if(tik==0)
{
for(i=0;i<b;i++)
{
buf[i]=Bid;
}
ExtMapBuffer2[0]=Bid+5*Point;
ExtMapBuffer2[1]=Bid-5*Point;
tik=1;
}
MaxB=0;MinB=1000;
for(i=b-1;i>0;i--)
{
buf[i]=buf[i-1];
if(MaxB<buf[i])MaxB=buf[i];
if(MinB>buf[i])MinB=buf[i];
}
buf[0]=Bid;
for(i=0;i<b;i++)
{
ExtMapBuffer1[i]=buf[i];
}
if(MathCeil(t/10)*10==t)
{
for(i=b;i<Bars;i++)
{
ExtMapBuffer1[i]=Bid;
}
ArrayInitialize(ExtMapBuffer2,Bid);
if(MaxB-Bid<5*Point)ExtMapBuffer2[0]=Bid+5*Point;
if(Bid-MinB<5*Point)ExtMapBuffer2[1]=Bid-5*Point;
//Print(MaxB, "+",Bid, "+",MinB);
}
//----
return(0);
}
//+------------------------------------------------------------------+
On its basis we make CCI... the same tick...
Commodity Channel Index
ORIGINAL
Calculation
Find a typical price. To do it, add high, low and close price of each bar and divide the sum by 3.
TP = (HIGH + LOW + CLOSE) / 3
Calculate an n-period simple moving average of typical prices.
SMA (TP, N) = SUM (TP, N) / N
Subtract the resulting SMA(TP, N) from the typical TP prices of each of the preceding n periods.
D = TP - SMA(TP, N)
4. Calculate the n-period simple moving average of the absolute values of D
SMA (D, N) = SUM (D, N) / N
5) Multiply SMA (D, N) by 0.015
M = SMA (D, N) * 0.015
6. divide M by D
CCI = M / D
where:
HIGH - maximum price of the bar;
LOW - minimum price of the bar;
CLOSE - closing price;
SMA - simple moving average;
SUM - sum;
N - number of periods used for the calculation.
Namely... point by point... what is to be done
1) Find a typical price. To do this add up the high, low and closing price of each bar and divide the sum by 3.
TP = (HIGH + LOW + CLOSE) / 3
Since there is no HIGH and LOW on ticks, we simply take the value of the price on the tick
2) Calculate an n-period simple moving average
SMA (TP, N) = SUM (TP, N) / N
Calculate the n-period simple moving average of prices from #1
3) Subtract the resulting SMA(TP, N) from the typical TP prices of each of the preceding n periods.
D = TP - SMA(TP, N)
Subtract the resulting SMA (#2) from (#1) of each of the preceding n periods.
4) Calculate the n-period simple moving average of absolute values D
SMA (D, N) = SUM (D, N) / N
This is how we do it.
5) Multiply obtained SMA (D, N) by 0.015
M = SMA (D, N) * 0.015
This is how we do it...
6) Divide M by D
CCI = M / D
That's how we do it...
NOW IN PURPOSE ... drawing of ToR (I hope I described it clearly above)...
Drawing the inductor ALL the above described ....
ADDIONS...
In the settings of the indicator (INPUT PARAMETERS)... make these adjustable parameters... (I will indicate the additions with explanations)
1) Specify the CCI period (everything is clear here)
Specify "Period CCI" in the settings.
2) Specify the value (0.015) with the possibility of changing it ... (it doesn't affect anything in particular - but for convenience ...)
In settings specify "Znach".
3) Let's make "Alerts" ...
ALL "Alerts" with possibility to enable (True) and disable (False)
ALL "Alerts" with possibility of sound signal (configurable - so it can be on/off)
3.1) INDJUNCTION = 0 (level = NULL)
Set to "Uroven0".
3.2) Intersection of all INDUCLE values = any Setpoint... (level)
For example (level = 100) or (level = -35) with a POSSIBLE ability to change... (level)... to produce a signal...
INSTALLED FOR values in + and values in -
with possibility of switching them ON (True) and OFF (False) ALWAYS
At the settings it is set as "Uroven+".
In the settings indicate "Uroven-".
FURTHER... In the settings of the indicator (COLORS) = make it possible to change colours,
any of corresponding parameters.
now we want to get proper (graphic) view of the given indicator
EXAMPLE in Fig.(then explanations)...
1) Divide each new minute with a vertical line (red in the picture)
2) Print the time in hour:min. At the opening of the current BAR (or the current CURRENT).
So if there was a missed minute, instead of 07:06 it will be 07:09 for example.
NOW the desired additions ...(if possible)
1) (first and last... )))))))) possibility of setting MA by already received values... (see fig.) I hope everything is clear...
And again with the possibility of choosing...
1.1) PERIOD of a given MA
1.2) colour of the given MA
1.3) and the "Alerts" setup by the intersection of level=0 of this MA
1.4) and also separate for МА on intersections of levels (for example, +200 and -50) ALERT
Figure 2.
For some reason I think you forgot to attach a picture.
Dear Kubodel!
is it possible to make an EA out of this indicator 'T3 TRIX (ROC of T6)'?
the yellow one crosses the blue one downwards - sell, upwards - buy
The deal is opened at the opening of the candle following the crossover
I may be a bit programmer myself, but I do not have the brains for it (((
as an option - position is closed when blue moves down or up, i.e. by changing direction
ready to pay 10 Usd.
Bigboom, send the production to integrum-perm@mail.ru. As long as I will not see it I cannot say anything exact.
Egay! Bravo to Kubodel!
I got my expert :)
The technical implementation is super, exactly as I needed.
I am going to test it for a couple of weeks on demo and then maybe I will give my account to electronic comrade.
>> Thank you very much.
Good afternoon!!!
What an interesting place you have here!!!
Do you take dummies in your ranks?! :)
For some reason I think you forgot to attach a picture.
again he doesn't want to...attach why I don't know...??
Perhaps a private email...or an email account???