/*[[ Name := 10pipnumbers Author := Rev 050609A, Copyright © 2005, Harry Burford Link := Separate Window := No First Color := Blue First Draw Type := Line First Symbol := 217 Use Second Data := Yes Second Color := Red Second Draw Type := Line Second Symbol := 218 ]]*/ // rev 050609A // ################################### // # code for 10pip lines # // # by Harry Burford # // # If you don't like it, tell ME # // # If you do like it, tell my boss # // ################################### // NO TRADE IN THIS SCRIPT. JUST OBJECT DRAWING. // NO warranty or guarentee for this script. But, I'd sure like to hear about problems // so I can have an opportunity to fix them. // *** REVISION NOTES *** // * this rev expects manual entry of pre hi/lo, I'd eventually like to do automatic look back // * this is my first script. Pass me your fixes and suggestions so I can update it. // * I do things differently from other scripts I've seen. I comment my work. // *** INSTRUCTIONS *** // attach script to a chart (1m is best because of label placement, but any) // enter pre-hi and pre-lo numbers read from 4xme 720 chart // wait for uptick and lines will be drawn // make a note of the numbers if desired // remove the expert advisor and the objects will remain on the Chart // If you do NO remove the advisor after running, then the numbers won't be right on other chart views // remove objects and rerun script when you need to update the lines // normally 10pip numbers are calculated about every 4 hours starting at the 2 AM CDT fresh 720 update defines: Pre_hi(1); defines: Pre_lo(1); defines: linethickness(1); var: cnt(0); //var: pre_hi(0); //var: pre_lo(999); var: hi_pass(0); var: lo_pass(0); var: mp(0); var: er_hi(0); var: er_lo(0); var: erange(0); var: r3(0); // *** find the pre HI and pre LO in previous 24 hours from right now *** // *** expect this script to run on the 1m chart *** // *** this routine removed for now expecting manual entry of pre-hi and pre-lo *** // *** this is a routine in process *** //for cnt = 1440 downto 1 //{ // pre_hi = max(pre_hi, high[cnt]); // pre_lo = min(pre_lo, low[cnt]); //continue; //} // *** calculate all the 10pip numbers *** hi_pass = pre_hi + 0.002 ; lo_pass = pre_lo - 0.002 ; mp = (((pre_hi - pre_lo) / 2) + pre_lo); erange = (pre_hi - pre_lo); // *** which entry range amount to use? *** // *** less than 160 range *** IF (erange <= 0.016) THEN (r3 = 0.004) ELSE (r3 = (erange * 0.25)) END; // *** set entry range *** er_hi = (pre_hi - r3); er_lo = (pre_lo + r3); // *** print the numbers on the chart for reference *** Comment("HighPASS= ",hi_pass,"\nPreHI= ",pre_hi,"\nERhi= ",er_hi,"\nmp= ",mp,"\nER_lo= ",er_lo,"\nPreLO= ",pre_lo,"\nLoPASS= ",lo_pass); // *** draw the lines on the chart *** // *** special case for ER if range < 80 *** // *** Prints an advisory message on the screen *** IF (erange <= 0.008) THEN { SetObjectText("LT80_txt","RANGE<80 ","Arial",10,White); MoveObject("LT80_txt",OBJ_TEXT,time[35],mp,time[35],mp,White); } // *** Draw lines *** MoveObject("MP",OBJ_HLINE,time[25],mp,Time[25],mp,Yellow,linethickness,STYLE_DOT); MoveObject("ER_Hi",OBJ_HLINE,time[25],er_hi,Time[25],er_hi,lime,linethickness,STYLE_DASH); MoveObject("ER_Lo",OBJ_HLINE,time[25],er_lo,Time[25],er_lo,red,linethickness,STYLE_DASH); MoveObject("Hi_Pass",OBJ_HLINE,time[25],hi_pass,time[25],hi_pass,lime,linethickness,STYLE_DOT); MoveObject("Lo_Pass",OBJ_HLINE,time[25],lo_pass,Time[25],lo_pass,red,linethickness,STYLE_DOT); MoveObject("Pre_Hi",OBJ_HLINE,time[25],pre_hi,Time[25],pre_hi,Yellow,linethickness,STYLE_DASH); MoveObject("Pre_Lo",OBJ_HLINE,time[25],pre_lo,Time[25],pre_lo,Yellow,linethickness,STYLE_DASH); // *** label the lines *** SetObjectText("MP_txt","MP ","Arial",8,White); MoveObject("MP_txt",OBJ_TEXT,time[25],mp,time[25],mp,White); SetObjectText("ER_Hi_txt","ERHI ","Arial",8,White); MoveObject("ER_Hi_txt",OBJ_TEXT,time[25],er_hi,time[25],er_hi,White); SetObjectText("ER_Lo_txt","ERLO ","Arial",8,White); MoveObject("ER_Lo_txt",OBJ_TEXT,time[25],er_lo,time[25],er_lo,White); SetObjectText("Hi_Pass_txt","HiPASS ","Arial",8,White); MoveObject("Hi_Pass_txt",OBJ_TEXT,time[25],hi_Pass,time[25],hi_pass,White); SetObjectText("Lo_Pass_txt","LoPASS ","Arial",8,White); MoveObject("Lo_Pass_txt",OBJ_TEXT,time[25],lo_pass,time[25],lo_pass,White); SetObjectText("Pre_Hi_txt","PreHI ","Arial",8,White); MoveObject("Pre_Hi_txt",OBJ_TEXT,time[25],pre_hi,time[25],pre_hi,White); SetObjectText("Pre_Lo_txt","PreLO ","Arial",8,White); MoveObject("Pre_Lo_txt",OBJ_TEXT,time[25],pre_lo,time[25],pre_lo,White); // *** end of the script ***