• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 11:31am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 11:31am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

My MT4 platform cannot open new charts - please assist! 10 replies

Are you a Programmer? - please assist 2 replies

Screen wipe - please assist 11 replies

Help! Assist coding SIROC indicator for MT4 0 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 2
Attachments: Auto Pivot Point in MetaTrader coding assist please
Exit Attachments
Tags: Auto Pivot Point in MetaTrader coding assist please
Cancel

Auto Pivot Point in MetaTrader coding assist please

  • Post #1
  • Quote
  • First Post: Jan 19, 2006 9:53pm Jan 19, 2006 9:53pm
  •  Ricx
  • | Joined Jan 2006 | Status: Member | 132 Posts
Hi i need assist to perfecting this code i got this one from my friend this indicator is used for automaticly draws Pivot Points for each day here the code by Jim Arner

//+------------------------------------------------------------------+
//| PV4.mq4 |
//| Jim Arner |
//| |
//+------------------------------------------------------------------+

#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+

int init()
{
//---- indicators

//---- indicators



//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{

double yesterday_high;
double yesterday_low;
double yesterday_close;
double array_price[][6];
double P,S0.5,R0.5,S1,R1,S1.5,R1.5,S2,R2,S2.5,R2.5,S3,R3;

//---- TODO: add your code here

ArrayInitialize(array_price,0);
ArrayCopyRates(array_price,(Symbol()), PERIOD_D1);

yesterday_high = array_price[1][3];
yesterday_low = array_price[1][2];
yesterday_close = array_price[1][4];

P = ((yesterday_high + yesterday_low + yesterday_close)/3);

R1 = (2*P)-yesterday_low;
S1 = (2*P)-yesterday_high;

R0.5 = (P+R1)/2;
S0.5 = (P+S1)/2;

R2 = P+(R1-S1);
S2 = P-(R1-S1);

R1.5 = (R1+R2)/2;
S1.5 = (S1+S2)/2;

R3 = (yesterday_high + (2*(P-yesterday_low)));
S3 = (yesterday_low - (2*(yesterday_high-P)));

Comment("PV3_10","\nR3=",R3,"\nR2=",R2,"\nR1.5=",R1.5,"\nR1=",R1,"\nR0.5=",R0.5,"\nP=",P,"\nS0.5=",S0.5,"\nS1=",S1,"\nS1.5=",S1.5,"\nS2=",S2,"\nS3=",S3);
ObjectDelete("P_Line");
ObjectDelete("S1_Line");
ObjectDelete("R1_Line");
ObjectDelete("S2_Line");
ObjectDelete("R2_Line");
ObjectDelete("S3_Line");
ObjectDelete("R3_Line");
ObjectDelete("S0.5_Line");
ObjectDelete("R0.5_Line");
ObjectDelete("S1.5_Line");
ObjectDelete("R1.5_Line");
ObjectDelete("P_Line");
ObjectDelete("S1_Line");
ObjectDelete("R1_Line");
ObjectDelete("S2_Line");
ObjectDelete("R2_Line");
ObjectDelete("S3_Line");
ObjectDelete("R3_Line");
ObjectDelete("S0.5_Line");
ObjectDelete("R0.5_Line");
ObjectDelete("S1.5_Line");
ObjectDelete("R1.5_Line");


ObjectCreate("P_Line", OBJ_HLINE,0, CurTime(),P);
ObjectSet("P_Line",OBJPROP_COLOR,Magenta);
ObjectSet("P_Line",OBJPROP_STYLE,STYLE_DASH);

ObjectCreate("S1_Line", OBJ_HLINE,0, CurTime(),S1);
ObjectSet("S1_Line",OBJPROP_COLOR,GreenYellow);
ObjectSet("S1_Line",OBJPROP_STYLE,STYLE_DASHDOTDOT);

ObjectCreate("R1_Line", OBJ_HLINE,0, CurTime(),R1);
ObjectSet("R1_Line",OBJPROP_COLOR,OrangeRed);
ObjectSet("R1_Line",OBJPROP_STYLE,STYLE_DASHDOTDOT);

ObjectCreate("S2_Line", OBJ_HLINE,0, CurTime(),S2);
ObjectSet("S2_Line",OBJPROP_COLOR,GreenYellow);
ObjectSet("S2_Line",OBJPROP_STYLE,STYLE_DASHDOTDOT);

ObjectCreate("R2_Line", OBJ_HLINE,0, CurTime(),R2);
ObjectSet("R2_Line",OBJPROP_COLOR,OrangeRed);
ObjectSet("R2_Line",OBJPROP_STYLE,STYLE_DASHDOTDOT);

ObjectCreate("S3_Line", OBJ_HLINE,0, CurTime(),S3);
ObjectSet("S3_Line",OBJPROP_COLOR,GreenYellow);
ObjectSet("S3_Line",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("S3_Line",OBJPROP_WIDTH,3);

ObjectCreate("R3_Line", OBJ_HLINE,0, CurTime(),R3);
ObjectSet("R3_Line",OBJPROP_COLOR,OrangeRed);
ObjectSet("R3_Line",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("R3_Line",OBJPROP_WIDTH,3);

ObjectCreate("S0.5_Line", OBJ_HLINE,0, CurTime(),S0.5);
ObjectSet("S0.5_Line",OBJPROP_COLOR,GreenYellow);
ObjectSet("S0.5_Line",OBJPROP_STYLE,STYLE_DOT);

ObjectCreate("R0.5_Line", OBJ_HLINE,0, CurTime(),R0.5);
ObjectSet("R0.5_Line",OBJPROP_COLOR,OrangeRed);
ObjectSet("R0.5_Line",OBJPROP_STYLE,STYLE_DOT);

ObjectCreate("S1.5_Line", OBJ_HLINE,0, CurTime(),S1.5);
ObjectSet("S1.5_Line",OBJPROP_COLOR,GreenYellow);
ObjectSet("S1.5_Line",OBJPROP_STYLE,STYLE_DOT);

ObjectCreate("R1.5_Line", OBJ_HLINE,0, CurTime(),R1.5);
ObjectSet("R1.5_Line",OBJPROP_COLOR,OrangeRed);
ObjectSet("R1.5_Line",OBJPROP_STYLE,STYLE_DOT);

ObjectsRedraw();

return(0);
}
//+------------------------------------------------------------------+






and here is my modification of Jim code :
//+------------------------------------------------------------------+
//| PV4.mq4 |
//| Jim Arner |
//| |
//+------------------------------------------------------------------+

#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+

int init()
{
//---- indicators

//---- indicators



//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{

double yesterday_high;
double yesterday_low;
double yesterday_close;
double array_price[][6];
double P,S0.5,R0.5,S1,R1,S1.5,R1.5,S2,R2,S2.5,R2.5,S3,R3;

//---- TODO: add your code here

ArrayInitialize(array_price,0);
ArrayCopyRates(array_price,(Symbol()), PERIOD_D1);

yesterday_high = array_price[1][3];
yesterday_low = array_price[1][2];
yesterday_close = array_price[1][4];

P = ((yesterday_high + yesterday_low + yesterday_close)/3);

R1 = (2*P)-yesterday_low;
S1 = (2*P)-yesterday_high;

R0.5 = (P+R1)/2;
S0.5 = (P+S1)/2;

R2 = P+(R1-S1);
S2 = P-(R1-S1);

R1.5 = (R1+R2)/2;
S1.5 = (S1+S2)/2;

R3 = (yesterday_high + (2*(P-yesterday_low)));
S3 = (yesterday_low - (2*(yesterday_high-P)));


ObjectDelete("P_Line");
ObjectDelete("S1_Line");
ObjectDelete("R1_Line");
ObjectDelete("S2_Line");
ObjectDelete("R2_Line");
ObjectDelete("S3_Line");
ObjectDelete("R3_Line");
ObjectDelete("S0.5_Line");
ObjectDelete("R0.5_Line");
ObjectDelete("S1.5_Line");
ObjectDelete("R1.5_Line");
ObjectDelete("P_Line");
ObjectDelete("S1_Line");
ObjectDelete("R1_Line");
ObjectDelete("S2_Line");
ObjectDelete("R2_Line");
ObjectDelete("S3_Line");
ObjectDelete("R3_Line");
ObjectDelete("S0.5_Line");
ObjectDelete("R0.5_Line");
ObjectDelete("S1.5_Line");
ObjectDelete("R1.5_Line");


ObjectCreate("P_Line", OBJ_HLINE,0, CurTime(),P);
ObjectSet("P_Line",OBJPROP_COLOR,Goldenrod);
ObjectSet("P_Line",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetText("P_Line", "PIVOT", 12, "Georgia", Black);

ObjectCreate("S1_Line", OBJ_HLINE,0, CurTime(),S1);
ObjectSet("S1_Line",OBJPROP_COLOR,Blue);
ObjectSet("S1_Line",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetText("S1_Line", "S1", 10, "Times New Roman", Black);

ObjectCreate("R1_Line", OBJ_HLINE,0, CurTime(),R1);
ObjectSet("R1_Line",OBJPROP_COLOR,Red);
ObjectSet("R1_Line",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetText("R1_Line", "R1", 12, "Georgia", Black);

ObjectCreate("S2_Line", OBJ_HLINE,0, CurTime(),S2);
ObjectSet("S2_Line",OBJPROP_COLOR,Blue);
ObjectSet("S2_Line",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetText("S2_Line", "S2", 12, "Georgia", Black);

ObjectCreate("R2_Line", OBJ_HLINE,0, CurTime(),R2);
ObjectSet("R2_Line",OBJPROP_COLOR,Red);
ObjectSet("R2_Line",OBJPROP_STYLE,STYLE_SOLID);
ObjectSetText("R2_Line", "R2", 12, "Georgia", Black);

ObjectCreate("S3_Line", OBJ_HLINE,0, CurTime(),S3);
ObjectSet("S3_Line",OBJPROP_COLOR,Goldenrod);
ObjectSet("S3_Line",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("S3_Line",OBJPROP_WIDTH,2);
ObjectSetText("S3_Line", "S3", 12, "Georgia", Black);

ObjectCreate("R3_Line", OBJ_HLINE,0, CurTime(),R3);
ObjectSet("R3_Line",OBJPROP_COLOR,Goldenrod);
ObjectSet("R3_Line",OBJPROP_STYLE,STYLE_SOLID);
ObjectSet("R3_Line",OBJPROP_WIDTH,2);
ObjectSetText("R3_Line", "R3", 12, "Georgia", Black);

ObjectCreate("S0.5_Line", OBJ_HLINE,0, CurTime(),S0.5);
ObjectSet("S0.5_Line",OBJPROP_COLOR,Blue);
ObjectSet("S0.5_Line",OBJPROP_STYLE,STYLE_DOT);
ObjectSetText("S0.5_Line", "S0.5", 12, "Georgia", Black);

ObjectCreate("R0.5_Line", OBJ_HLINE,0, CurTime(),R0.5);
ObjectSet("R0.5_Line",OBJPROP_COLOR,Red);
ObjectSet("R0.5_Line",OBJPROP_STYLE,STYLE_DOT);
ObjectSetText("R0.5_Line", "R0.5", 12, "Georgia", Black);

ObjectCreate("S1.5_Line", OBJ_HLINE,0, CurTime(),S1.5);
ObjectSet("S1.5_Line",OBJPROP_COLOR,Blue);
ObjectSet("S1.5_Line",OBJPROP_STYLE,STYLE_DOT);
ObjectSetText("S1.5_Line", "S1.5", 12, "Georgia", Black);

ObjectCreate("R1.5_Line", OBJ_HLINE,0, CurTime(),R1.5);
ObjectSet("R1.5_Line",OBJPROP_COLOR,Red);
ObjectSet("R1.5_Line",OBJPROP_STYLE,STYLE_DOT);
ObjectSetText("R1.5_Line", "R1.5", 12, "Georgia", Black);

ObjectsRedraw();

return(0);
}
//+------------------------------------------------------------------+






OK this 2 code is only works from saturday to friday for Monday it cant draw the pivot correctly cause its take the last calculation from sunday.

Any help to newbie ? Thank You all.
  • Post #2
  • Quote
  • Jan 19, 2006 10:19pm Jan 19, 2006 10:19pm
  •  eagle4x
  • | Joined Sep 2005 | Status: pip my ride | 507 Posts
If you need a pivot point indicator for MT4 I can send it to you, but not sure if it meets your criteria
 
 
  • Post #3
  • Quote
  • Jan 19, 2006 10:32pm Jan 19, 2006 10:32pm
  •  Ricx
  • | Joined Jan 2006 | Status: Member | 132 Posts
sure thank you id love to have yours too.
 
 
  • Post #4
  • Quote
  • Jan 19, 2006 10:55pm Jan 19, 2006 10:55pm
  •  eagle4x
  • | Joined Sep 2005 | Status: pip my ride | 507 Posts
I get an error msg. when I try to download it. If you would, just PM me with your e-mail addr. and I will send it to you. And I will do the same for anyone
else who requests it.
 
 
  • Post #5
  • Quote
  • Jan 19, 2006 11:53pm Jan 19, 2006 11:53pm
  •  Liquid4x
  • | Joined May 2005 | Status: Pips Ahoy! | 207 Posts
Here try these two pivot indicators...
Attached File(s)
File Type: mq4 Pivot Lines.mq4   14 KB | 865 downloads
File Type: mq4 Pivot.mq4   5 KB | 821 downloads
 
 
  • Post #6
  • Quote
  • Edited 11:32am Jan 20, 2006 11:06am | Edited 11:32am
  •  Ricx
  • | Joined Jan 2006 | Status: Member | 132 Posts
Quoting Liquid4x
Disliked
Here try these two pivot indicators...
Ignored
Thank You, i had tried all 2 of them both have great system.

i like the pivot.mg4 but i cant modify to add more line because it
only have only 8 indicator_color buffer so i cant add the 0.5 & 1.5 Res&Sup
lines.

i like the pivot_lines.mg4 here are i made some modification for it
//+------------------------------------------------------------------+
//| Pivot.mq4 |
//| Copyright 2004, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2004, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

#property indicator_chart_window

extern bool pivots = true;
extern bool camarilla = false;
extern bool midpivots = true;

double day_high=0;
double day_low=0;
double yesterday_high=0;
double yesterday_open=0;
double yesterday_low=0;
double yesterday_close=0;
double today_open=0;
double today_high=0;
double today_low=0;
double P=0;
double Q=0;
double R1,R2,R3;
double S2.5,S1.5,S0.5,R0.5,R1.5,R2.5;
double S1,S2,S3;
double H4,H3,L4,L3;
double nQ=0;
double nD=0;
double D=0;
double rates_d1[2][6];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
R1=0; R2=0; R3=0;
S2.5=0; S1.5=0; S0.5=0; R0.5=0; R1.5=0; R2.5=0;
S1=0; S2=0; S3=0;
H4=0; H3=0; L4=0; L3=0;
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
ObjectDelete("R1 Label");
ObjectDelete("R1 Line");
ObjectDelete("R2 Label");
ObjectDelete("R2 Line");
ObjectDelete("R3 Label");
ObjectDelete("R3 Line");
ObjectDelete("S1 Label");
ObjectDelete("S1 Line");
ObjectDelete("S2 Label");
ObjectDelete("S2 Line");
ObjectDelete("S3 Label");
ObjectDelete("S3 Line");
ObjectDelete("P Label");
ObjectDelete("P Line");
ObjectDelete("H4 Label");
ObjectDelete("H4 Line");
ObjectDelete("H3 Label");
ObjectDelete("H3 Line");
ObjectDelete("L3 Label");
ObjectDelete("L3 Line");
ObjectDelete("L4 Label");
ObjectDelete("L4 Line");
ObjectDelete("R2.5 Label");
ObjectDelete("R2.5 Line");
ObjectDelete("R1.5 Label");
ObjectDelete("R1.5 Line");
ObjectDelete("R0.5 Label");
ObjectDelete("R0.5 Line");
ObjectDelete("S0.5 Label");
ObjectDelete("S0.5 Line");
ObjectDelete("S1.5 Label");
ObjectDelete("S1.5 Line");
ObjectDelete("S2.5 Label");
ObjectDelete("S2.5 Line");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//---- TODO: add your code here
//---- exit if period is greater than daily charts
if(Period() > 1440)
{
Print("Error - Chart period is greater than 1 day.");
return(-1); // then exit
}
//---- Get new daily prices
ArrayCopyRates(rates_d1, Symbol(), PERIOD_D1);

yesterday_close = rates_d1[1][4];
yesterday_open = rates_d1[1][1];
today_open = rates_d1[0][1];
yesterday_high = rates_d1[1][3];
yesterday_low = rates_d1[1][2];
day_high = rates_d1[0][3];
day_low = rates_d1[0][2];
//---- Calculate Pivots

D = (day_high - day_low);
Q = (yesterday_high - yesterday_low);
P = (yesterday_high + yesterday_low + yesterday_close) / 3;
R1 = (2*P)-yesterday_low;
S1 = (2*P)-yesterday_high;
R2 = P+(yesterday_high - yesterday_low);
S2 = P-(yesterday_high - yesterday_low);

H4 = (Q*0.55)+yesterday_close;
H3 = (Q*0.27)+yesterday_close;
R3 = (2*P)+(yesterday_high-(2*yesterday_low));
R2.5 = (R2+R3)/2;
R1.5 = (R1+R2)/2;
R0.5 = (P+R1)/2;
S0.5 = (P+S1)/2;
S1.5 = (S1+S2)/2;
S3 = (2*P)-((2* yesterday_high)-yesterday_low);
L3 = yesterday_close-(Q*0.27);
L4 = yesterday_close-(Q*0.55);
S2.5 = (S2+S3)/2;
if (Q > 5)
{
nQ = Q;
}
else
{
nQ = Q*10000;
}

if (D > 5)
{
nD = D;
}
else
{
nD = D*10000;
}
Comment("High= ",yesterday_high," Previous Days Range= ",nQ,"\nLow= ",yesterday_low," Current Days Range= ",nD,"\nClose= ",yesterday_close);
//---- Set line labels on chart window
//---- Pivot Lines
if (pivots==true)
{
if(ObjectFind("R1 label") != 0)
{
ObjectCreate("R1 label", OBJ_TEXT, 0, Time[20], R1);
ObjectSetText("R1 label", "R1", 8, "Georgia", Red);

}
else
{
ObjectMove("R1 label", 0, Time[20], R1);
}
if(ObjectFind("R2 label") != 0)
{
ObjectCreate("R2 label", OBJ_TEXT, 0, Time[20], R2);
ObjectSetText("R2 label", "R2", 8, "Georgia", Red);
}
else
{
ObjectMove("R2 label", 0, Time[20], R2);
}
if(ObjectFind("R3 label") != 0)
{
ObjectCreate("R3 label", OBJ_TEXT, 0, Time[20], R3);
ObjectSetText("R3 label", "R3", 8, "Georgia", Purple);
}
else
{
ObjectMove("R3 label", 0, Time[20], R3);
}
if(ObjectFind("P label") != 0)
{
ObjectCreate("P label", OBJ_TEXT, 0, Time[20], P);
ObjectSetText("P label", "Pivot", 8, "Georgia", Goldenrod);
}
else
{
ObjectMove("P label", 0, Time[20], P);
}
if(ObjectFind("S1 label") != 0)
{
ObjectCreate("S1 label", OBJ_TEXT, 0, Time[20], S1);
ObjectSetText("S1 label", "S1", 8, "Georgia", Blue);
}
else
{
ObjectMove("S1 label", 0, Time[20], S1);
}
if(ObjectFind("S2 label") != 0)
{
ObjectCreate("S2 label", OBJ_TEXT, 0, Time[20], S2);
ObjectSetText("S2 label", "S2", 8, "Georgia", Blue);
}
else
{
ObjectMove("S2 label", 0, Time[20], S2);
}
if(ObjectFind("S3 label") != 0)
{
ObjectCreate("S3 label", OBJ_TEXT, 0, Time[20], S3);
ObjectSetText("S3 label", "S3", 8, "Georgia", Purple);
}
else
{
ObjectMove("S3 label", 0, Time[20], S3);
}
//--- Draw Pivot lines on chart
if(ObjectFind("S1 line") != 0)
{
ObjectCreate("S1 line", OBJ_HLINE, 0, Time[40], S1);
ObjectSet("S1 line", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("S1 line", OBJPROP_COLOR, Blue);
}
else
{
ObjectMove("S1 line", 0, Time[40], S1);
}
if(ObjectFind("S2 line") != 0)
{
ObjectCreate("S2 line", OBJ_HLINE, 0, Time[40], S2);
ObjectSet("S2 line", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("S2 line", OBJPROP_COLOR, Blue);
}
else
{
ObjectMove("S2 line", 0, Time[40], S2);
}
if(ObjectFind("S3 line") != 0)
{
ObjectCreate("S3 line", OBJ_HLINE, 0, Time[40], S3);
ObjectSet("S3 line", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("S3 line", OBJPROP_COLOR, Purple);
}
else
{
ObjectMove("S3 line", 0, Time[40], S3);
}
if(ObjectFind("P line") != 0)
{
ObjectCreate("P line", OBJ_HLINE, 0, Time[40], P);
ObjectSet("P line", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("P line", OBJPROP_COLOR, Goldenrod);
}
else
{
ObjectMove("P line", 0, Time[40], P);
}
if(ObjectFind("R1 line") != 0)
{
ObjectCreate("R1 line", OBJ_HLINE, 0, Time[40], R1);
ObjectSet("R1 line", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("R1 line", OBJPROP_COLOR, Red);
}
else
{
ObjectMove("R1 line", 0, Time[40], R1);
}
if(ObjectFind("R2 line") != 0)
{
ObjectCreate("R2 line", OBJ_HLINE, 0, Time[40], R2);
ObjectSet("R2 line", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("R2 line", OBJPROP_COLOR, Red);
}
else
{
ObjectMove("R2 line", 0, Time[40], R2);
}
if(ObjectFind("R3 line") != 0)
{
ObjectCreate("R3 line", OBJ_HLINE, 0, Time[40], R3);
ObjectSet("R3 line", OBJPROP_STYLE, STYLE_SOLID);
ObjectSet("R3 line", OBJPROP_COLOR, Purple);
}
else
{
ObjectMove("R3 line", 0, Time[40], R3);
}
}
//---- End of Pivot Line Draw
//----- Camarilla Lines
if (camarilla==true)
{
if(ObjectFind("H4 label") != 0)
{
ObjectCreate("H4 label", OBJ_TEXT, 0, Time[20], H4);
ObjectSetText("H4 label", " H4", 8, "Georgia", Black);
}
else
{
ObjectMove("H4 label", 0, Time[20], H4);
}
if(ObjectFind("H3 label") != 0)
{
ObjectCreate("H3 label", OBJ_TEXT, 0, Time[20], H3);
ObjectSetText("H3 label", " H3", 8, "Georgia", Black);
}
else
{
ObjectMove("H3 label", 0, Time[20], H3);
}
if(ObjectFind("L3 label") != 0)
{
ObjectCreate("L3 label", OBJ_TEXT, 0, Time[20], L3);
ObjectSetText("L3 label", " L3", 8, "Georgia", Black);
}
else
{
ObjectMove("L3 label", 0, Time[20], L3);
}
if(ObjectFind("L4 label") != 0)
{
ObjectCreate("L4 label", OBJ_TEXT, 0, Time[20], L4);
ObjectSetText("L4 label", " L4", 8, "Georgia", Black);
}
else
{
ObjectMove("L4 label", 0, Time[20], L4);
}
//---- Draw Camarilla lines on Chart
if(ObjectFind("H4 line") != 0)
{
ObjectCreate("H4 line", OBJ_HLINE, 0, Time[40], H4);
ObjectSet("H4 line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
ObjectSet("H4 line", OBJPROP_COLOR, Gray);
}
else
{
ObjectMove("H4 line", 0, Time[40], H4);
}
if(ObjectFind("H3 line") != 0)
{
ObjectCreate("H3 line", OBJ_HLINE, 0, Time[40], H3);
ObjectSet("H3 line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
ObjectSet("H3 line", OBJPROP_COLOR, Gray);
}
else
{
ObjectMove("H3 line", 0, Time[40], H3);
}
if(ObjectFind("L3 line") != 0)
{
ObjectCreate("L3 line", OBJ_HLINE, 0, Time[40], L3);
ObjectSet("L3 line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
ObjectSet("L3 line", OBJPROP_COLOR, Gray);
}
else
{
ObjectMove("L3 line", 0, Time[40], L3);
}
if(ObjectFind("L4 line") != 0)
{
ObjectCreate("L4 line", OBJ_HLINE, 0, Time[40], L4);
ObjectSet("L4 line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
ObjectSet("L4 line", OBJPROP_COLOR, Gray);
}
else
{
ObjectMove("L4 line", 0, Time[40], L4);
}
}
//-------End of Draw Camarilla Lines
//------ Midpoints Pivots
if (midpivots==true)
{
if(ObjectFind("R2.5 label") != 0)
{
ObjectCreate("R2.5 label", OBJ_TEXT, 0, Time[20], R2.5);
ObjectSetText("R2.5 label", " R2.5", 8, "Georgia", Red);
}
else
{
ObjectMove("R2.5 label", 0, Time[20], R2.5);
}
if(ObjectFind("R1.5 label") != 0)
{
ObjectCreate("R1.5 label", OBJ_TEXT, 0, Time[20], R1.5);
ObjectSetText("R1.5 label", " R1.5", 8, "Georgia", Red);
}
else
{
ObjectMove("R1.5 label", 0, Time[20], R1.5);
}
if(ObjectFind("R0.5 label") != 0)
{
ObjectCreate("R0.5 label", OBJ_TEXT, 0, Time[20], R0.5);
ObjectSetText("R0.5 label", " R0.5", 8, "Georgia", Red);
}
else
{
ObjectMove("R0.5 label", 0, Time[20], R0.5);
}
if(ObjectFind("S0.5 label") != 0)
{
ObjectCreate("S0.5 label", OBJ_TEXT, 0, Time[20], S0.5);
ObjectSetText("S0.5 label", " S0.5", 8, "Georgia", Blue);
}
else
{
ObjectMove("S0.5 label", 0, Time[20], S0.5);
}
if(ObjectFind("S1.5 label") != 0)
{
ObjectCreate("S1.5 label", OBJ_TEXT, 0, Time[20], S1.5);
ObjectSetText("S1.5 label", " S1.5", 8, "Georgia", Blue);
}
else
{
ObjectMove("S1.5 label", 0, Time[20], S1.5);
}
if(ObjectFind("S2.5 label") != 0)
{
ObjectCreate("S2.5 label", OBJ_TEXT, 0, Time[20], S2.5);
ObjectSetText("S2.5 label", " S2.5", 8, "Georgia", Blue);
}
else
{
ObjectMove("S2.5 label", 0, Time[20], S2.5);
}
//---- Draw Midpoint Pivots on Chart
if(ObjectFind("R2.5 line") != 0)
{
ObjectCreate("R2.5 line", OBJ_HLINE, 0, Time[40], R2.5);
ObjectSet("R2.5 line", OBJPROP_STYLE, STYLE_DOT);
ObjectSet("R2.5 line", OBJPROP_COLOR, Red);
}
else
{
ObjectMove("R2.5 line", 0, Time[40], R2.5);
}
if(ObjectFind("R1.5 line") != 0)
{
ObjectCreate("R1.5 line", OBJ_HLINE, 0, Time[40], R1.5);
ObjectSet("R1.5 line", OBJPROP_STYLE, STYLE_DOT);
ObjectSet("R1.5 line", OBJPROP_COLOR, Red);
}
else
{
ObjectMove("R1.5 line", 0, Time[40], R1.5);
}
if(ObjectFind("R0.5 line") != 0)
{
ObjectCreate("R0.5 line", OBJ_HLINE, 0, Time[40], R0.5);
ObjectSet("R0.5 line", OBJPROP_STYLE, STYLE_DOT);
ObjectSet("R0.5 line", OBJPROP_COLOR, Red);
}
else
{
ObjectMove("R0.5 line", 0, Time[40], R0.5);
}
if(ObjectFind("S0.5 line") != 0)
{
ObjectCreate("S0.5 line", OBJ_HLINE, 0, Time[40], S0.5);
ObjectSet("S0.5 line", OBJPROP_STYLE, STYLE_DOT);
ObjectSet("S0.5 line", OBJPROP_COLOR, Blue);
}
else
{
ObjectMove("S0.5 line", 0, Time[40], S0.5);
}
if(ObjectFind("S1.5 line") != 0)
{
ObjectCreate("S1.5 line", OBJ_HLINE, 0, Time[40], S1.5);
ObjectSet("S1.5 line", OBJPROP_STYLE, STYLE_DOT);
ObjectSet("S1.5 line", OBJPROP_COLOR, Blue);
}
else
{
ObjectMove("S1.5 line", 0, Time[40], S1.5);
}
if(ObjectFind("S2.5 line") != 0)
{
ObjectCreate("S2.5 line", OBJ_HLINE, 0, Time[40], S2.5);
ObjectSet("S2.5 line", OBJPROP_STYLE, STYLE_DOT);
ObjectSet("S2.5 line", OBJPROP_COLOR, Blue);
}
else
{
ObjectMove("S2.5 line", 0, Time[40], S2.5);
}
}
//----End of Midpoint Pivots Draw
//---- End Of Program
return(0);
}
//+------------------------------------------------------------------+

But at this one i cant modify the pivot color and the pivot text color... hm my knowledge in this programing is very limited but i like them all its better than my early pivot program i had.

Thank you.
 
 
  • Post #7
  • Quote
  • Jan 20, 2006 11:22am Jan 20, 2006 11:22am
  •  highway
  • Joined Sep 2005 | Status: Member | 1,352 Posts
Tried click Charts; then Object list.
Change color & size and text there ?

Hope this helps
Highway
 
 
  • Post #8
  • Quote
  • Jan 20, 2006 11:31am Jan 20, 2006 11:31am
  •  Ricx
  • | Joined Jan 2006 | Status: Member | 132 Posts
Sorry silly me i put some wrong case sensitive input

Purple i enter purple
Goldenrod i enter GoldenRod

its just a matter of case sensitivity

now my pivot are like the way i want it colors. i made some edit on my previous posts.
 
 
  • Post #9
  • Quote
  • Mar 6, 2006 6:01pm Mar 6, 2006 6:01pm
  •  erikcw
  • | Joined May 2005 | Status: Member | 9 Posts
Can the end of day time be customized on this indicator? As you may know, MT doesn't have the ability to customize the time zone, so this has to be done at the script level (counting bars).

Thanks!
 
 
  • Post #10
  • Quote
  • Mar 21, 2006 10:51am Mar 21, 2006 10:51am
  •  accrete
  • Joined Jan 2006 | Status: Pips Ahoy! | 1,130 Posts
Here is a link to my domain that has a directory of MT4 indicators that i have found on the web that i have "mirrored" for handy reference. Everything is public domain stuff, feel free to use whatever.

One indicator you may find useful is called "Pivot Lines Timezone" found inside the "mt4_indicators" folder at this link:

http://accrete.com/fx_mirror/

There are others that i find useful, and the ones with "circle" or "dot" are my hacks of popular indicators that i've changed the code on drawing a line to drawing dots at each candle/bar. I will put the line version on the chart/indicator (such as an RSI) then place the version that draws the dots. I like the visual it gives, below is just one example:
http://www.accrete.com/fx_posts/2006-01-24rsibb.PNG

or you can use "Moving Averages CIRCLE" to add long term MAs to a chart to not clutter things up so much?? :

http://www.accrete.com/fx_posts/misc...D16mar2006.PNG

Cheers,
Thom
 
 
  • Post #11
  • Quote
  • Last Post: Jan 19, 2011 5:07pm Jan 19, 2011 5:07pm
  •  Leche Mocha
  • | Joined Aug 2009 | Status: "Protect yo neck"- WuTang Financial | 854 Posts
pivot.mq4 is the indi I use.

Quoting Liquid4x
Disliked
Here try these two pivot indicators...
Ignored
 
 
  • Platform Tech
  • /
  • Auto Pivot Point in MetaTrader coding assist please
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023