camarilla(2)

Author: ForexMasterMaker.com, � 2005
0 Views
0 Downloads
0 Favorites
camarilla(2)
//+------------------------------------------------------------------+
//|                                             ForexMasterMaker.com |
//|                                                       Pivots.mq4 |
//+------------------------------------------------------------------+

#property copyright "ForexMasterMaker.com, © 2005"
#property link      "http://www.forexmastermaker.com."

#property indicator_chart_window
//---- input parameters
extern int       GMTshift=7;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//---- TODO: add your code here
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 P=0,S=0,R=0,S1=0,H4=0,S2=0,R2=0,S3=0,L4=0,nQ=0,nD=0,D=0;
double H3,H2,H1,L1,L2,L3;
int cnt=720;
double cur_day=0;
double prev_day=0;

double rates_d1[2][6];

//---- 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 & calculate pivots

while (cnt!= 0)
{
	cur_day = TimeDay(Time[cnt]- (GMTshift*3600));
	
	if (prev_day != cur_day)
	{
		yesterday_close = Close[cnt+1];
		today_open = Open[cnt];
		yesterday_high = day_high;
		yesterday_low = day_low;

		day_high = High[cnt];
		day_low  = Low[cnt];

		prev_day = cur_day;
	}
   
   if (High[cnt]>day_high)
   {
      day_high = High[cnt];
   }
   if (Low[cnt]<day_low)
   {
      day_low = Low[cnt];
   }
	
//	SetIndexValue(cnt, 0);
	cnt--;

}

//------ Pivot Points ------

P = (yesterday_high + yesterday_low + yesterday_close)/3;
H4 = (yesterday_high - yesterday_low)*0.55+yesterday_close;
H3 = (yesterday_high - yesterday_low)*0.275+yesterday_close;
L3 = yesterday_close-(yesterday_high - yesterday_low)*0.275;
L4 = yesterday_close-(yesterday_high - yesterday_low)*0.55;

//------ DRAWING LINES ------

Comment("Camarilla Levels by www.ForexMasterMaker.com");

ObjectDelete("L4_Line");
ObjectDelete("L3_Line");

ObjectDelete("H3_Line");
ObjectDelete("H4_Line");

ObjectCreate("L4_Line", OBJ_HLINE,0, CurTime(),L4);
ObjectSet("L4_Line",OBJPROP_COLOR,Red);
ObjectSet("L4_Line",OBJPROP_STYLE,STYLE_SOLID);

ObjectCreate("L3_Line", OBJ_HLINE,0, CurTime(),L3);
ObjectSet("L3_Line",OBJPROP_COLOR,Red);
ObjectSet("L3_Line",OBJPROP_STYLE,STYLE_SOLID);

ObjectCreate("H3_Line", OBJ_HLINE,0, CurTime(),H3);
ObjectSet("H3_Line",OBJPROP_COLOR,Red);
ObjectSet("H3_Line",OBJPROP_STYLE,STYLE_SOLID);

ObjectCreate("H4_Line", OBJ_HLINE,0, CurTime(),H4);
ObjectSet("H4_Line",OBJPROP_COLOR,Red);
ObjectSet("H4_Line",OBJPROP_STYLE,STYLE_SOLID);


ObjectsRedraw();

// --- Typing Labels

if(ObjectFind("L3 label") != 0)
{
ObjectCreate("L3 label", OBJ_TEXT, 0, Time[0], L3);
ObjectSetText("L3 label", " L3 ", 8, "Arial", Red);
}
else
{
ObjectMove("L3 label", 0, Time[0], L3);
}
   
if(ObjectFind("L4 label") != 0)
{
ObjectCreate("L4 label", OBJ_TEXT, 0, Time[0], L4);
ObjectSetText("L4 label", " L4 ", 8, "Arial", Red);
}
else
{
ObjectMove("L4 label", 0, Time[0], L4);
}

 if(ObjectFind("H4 label") != 0)
{
ObjectCreate("H4 label", OBJ_TEXT, 0, Time[0], H4);
ObjectSetText("H4 label", " H4 ", 8, "Arial", Red);
}
else
{
ObjectMove("H4 label", 0, Time[0], H4);
}

 if(ObjectFind("H3 label") != 0)
{
ObjectCreate("H3 label", OBJ_TEXT, 0, Time[0], H3);
ObjectSetText("H3 label", " H3 ", 8, "Arial", Red);
}
else
{
ObjectMove("H3 label", 0, Time[0], H3);
}

 if(ObjectFind("P label") != 0)
{
ObjectCreate(" label", OBJ_TEXT, 0, Time[0], );
ObjectSetText(" label", "  ", 8, "Arial", DeepPink);
}
else
{
ObjectMove("P label", 0, Time[0], P);
}  
   return(0);
 }
 //+------------------------------------------------------------------+

é>€}tcè¦øÿÿ…Àt	èÓ.‹ðë3ö…ötthö‹Æè÷ÿÿ…À|\hPöVè<…À|MFPÿpÐ…À}‹
@ÇPhpjè¯ùÿÿƒÄ‹j‹ÎÿhCCdDhpjÿ4Ð…Àt‹ðèi‹øë‹j‹Îÿ¾šÀéTÿÿÿ3ÿ…ÿ•Ã…ÿtëhPöEôPÿœÐ‹EüƒÀPEôPè%‹ð…ö}+VhЋ
@ÇjèXùÿÿƒÄ„Û„ÿÿÿ‹j‹ÏÿéùþÿÿGPÿuè°‹ð‹ÇèA	…ö}Vh0 뺄Ût‹j‹Ïÿ‹Mü‹jÿ3Àë
‹j‹Îÿ¸šÀ_^[ÉÂÌÌÌÌÌ̋ÿU‹ìƒäøƒìVÿЄÀt‹
@Çh jèÄøÿÿYY鴃}„‚ÿuD$PÿœÐ€}t%D$PÿÜÐ…À}‹
@ÇPhÐ jè}øÿÿƒÄD$èñQh?L$‹ðèR…À|
j‹Îè–T…À}‹
@ÇPh !jè=øÿÿƒÄL$èûQƒ}t"ÿuèM6…À}‹
@ÇPhp!jèøÿÿƒÄ^‹å]ÂÌÌÌÌÌ̋ÿU‹ìQQ‹EVWÆèböÿÿ…Àt	è,‹ðë3ö…ö„ñèÀÝÿÿƒÀ\Vèôÿÿ…ÀŒÓhxö‹Æèõÿÿ…ÀŒ¿è–ÝÿÿH‹F‹PÿR…À}0=Àt‹
@ÇPFPhÀ!jèJ÷ÿÿƒÄ‹j‹Îÿ3À釃eüEüPFP聅À}$‹
@ÇPh "jè÷ÿÿƒÄ3ÿ‹j‹Îÿ‹ÇëNƒeøEøPÿuèI‹ø…ÿ}‹
@ÇWh"jè÷ÿÿƒÄëÆ‹Eü;Eø‹M”Àˆéwÿÿÿ‹j‹Îÿ¸šÀ_^ÉÂÌÌÌÌ̋ÿU‹ìƒìVWÿu3öEìÇEìý‰uð‰uô‰uø‰uüèœg‹ø;þ}(‹
@ÇWh#jècöÿÿƒÄ‹÷Mìè^g_‹Æ^ÉÂ9uøu¾ÀëäÿuøÿtÐ;Æu¾{ÀëЋ@‹M‰ëÆÌÌÌÌÌ̋ÿW3ÿF‰~Ç(ûÇF,ûè)†èü(†,èmôÿÿ‰¾\‰¾`‰¾d‰¾h‰¾l‹Æ_ÃÌÌÌÌ̋ÿU‹ìV‹ñèöEt
…öt	jVÿ(ЋÆ^]ÂÌÌÌÌ̋ÿV‹ñWÇ(ûÇF,ûè2¾l‹…Ét‹ÿPƒ'¾h‹…Ét‹ÿPƒ'Ž,èËõÿÿŽ¿¼û‰9è¹õÿÿN‰9è¯õÿÿ_Ç8û^ÃÌÌÌÌÌ̋ÿU‹ìƒäøƒìHSV‹÷ÆD$è»ÿЄÀt‹
@ÇhP#jèõÿÿYY¸HÀ醋uV‡,èðñÿÿ…ÀŒo‹ßèU…À| ‹
@Çh #j^Vè«ôÿÿYYÆD$éàè¸Úÿÿ‰D$f‹@`fÑè·È·fÑèWfÁf‹òèUóÿÿ‹Ø…Û}Shð#j‹
@Çè†ôÿÿƒÄéÜ‹D$wƒÀ\VèHñÿÿ‹Ø…ÛŒÍÿu‹Æèºñÿÿ‹Ø…ÛŒ¹h`$V胋؅ی¤è*Úÿÿ‹uÿvH‹ÿP‹Ø…Û}‹
@ÇSVhp$jèôÿÿƒÄédƒd$ jj@jD$(P¸€‹ÎÇD$,Ôûè²*‹Ø…Û}ShÐ$‹
@ÇjèÉóÿÿƒÄéD$wP‹Îè@-…À}0‹
@ÇPh@%jèqóÿÿƒÄD$P‹Æè*.‹Ø…Û}Sh %먍D$èÍ/‹E·ƒÀh·Ñèèòÿÿ‹Ø…ÛŒªhö‹Æè=ðÿÿ‹Ø…ÛŒ”ÿu‹Æè•ðÿÿ‹Ø…ÛŒ€D$<è¢L— h?‹ðèVN‹Ø…Û}Sh&é;ÿwD$@h÷Pè5R‹Ø…ÛŒÿ·4D$@h öPèBR‹Ø…ÛŒújh(öD$DèÌQ‹Ø…ÛŒàjh0öD$Dè²Q‹Ø…ÛŒÆjh8öD$Dè˜Q‹Ø…ÛŒ¬¡@Ç‹@…Àt-Gè~&PD$@Pè;…À}‹
@ÇPhÀ&jè@òÿÿƒÄt$<è\N‡ PÿpЋ؅Û}Sh 'éR‹ßèw‹Ø…Û}Sh€'é:L$<è¿KL$èø'j^D$$PD$0PjjD$ PjD$0Pÿ·\ÇD$8²FhàÙÿxЋ؅Ûu‹
@Çhà'VèŸñÿÿYY»šÀéõjjD$4Pÿ|Ћ\‹Óÿ€Ð‹Ø3À;Øtûu4PPPjD$<PÿhЃ|$(t)h(‹
@ÇVè>ñÿÿYY»†Àé”Sh0(Vé•üÿÿ‹D$‹
„Ð;shð(ëǍhQh öPè#‹Ø…Û}ShP)ëō‡lPh°öÿt$è‹Ø…Û}Sh°)ë¢3ÛëCSh`&‹
@Çjè·ðÿÿƒÄL$<èuJL$è®&…Û}€|$t	‹Çè¦ë‹÷è‹Ã^[‹å]ÂÌÌÌÌ̋ŽhS3Û;ËWt‹ÿP‹Žh;Ët‹ÿP‰žh¾l‹;Ët‹ÿP‰¾`‹;ËtÿˆÑ‰‰ž\‰žd‹†4f‰f‰ž0‹Ff‰f‰^‹†$f‰_f‰ž [ÃÌÌÌÌÌ̋ÿV‹ð‹Žh…Ét	‹ÿP„Àt-f÷† þÿv‹Ž$ë3Éf÷Fþÿv‹Fë3ÀjPQè¹öÿÿè(ÿÿÿ^ÃÌÌÌÌÌ̋ÿU‹ìƒìVèîÿÿ…Àt	è1$‹ðë3ö…öu¸šÀë>W»0f‹fÑè·ÀƒÀèîÿÿ…À‰Eü|h@ö‹Æè9ìÿÿ…À‰Eü}‹j‹Îÿ‹Eü_^ÉÃW‹Æè‡ìÿÿ‹ø…ÿ|EøPEôPhÿFPÿlÐ…À}‹ø‹j‹Îÿ‹ÇëŋEø‰ƒ\‹Eô‰ƒ`3ÿëÞÌÌÌÌÌÌjhÿè쨃eäƒeüEäPÿuÿU‰EÜÇEüþÿÿÿ¾€…ÆtPh *j‹
@Çè˜îÿÿƒÄ¸ÀëC‹Mä‹ÿuÿuÿP‹ø‹Mä‹ÿP…þtWh€*ëÅ3Àë‹E싋‰Eà3À@ËeèÇEüþÿÿÿ‹Eà觨ÂÌÌÌÌ̋ÿ

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---