|
Startseite | Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
Programmierung MQL4 Hier gehts rund ums Programmieren in MQL4. |
|
Themen-Optionen | Thema durchsuchen | Ansicht |
|
|||
Linien anders/mehrfach darstellen
Ich könnte da mal die Hilfe von den Experten hier gebrauchen.
Ich habe einen wunderschönen Pivot Indikator gefunden: https://www.mql5.com/de/code/17262 Was mir an dem so gefällt ist, dass ich die Länge und die Position der Linien einstellen kann und mir die Pivotlinien nicht den kompletten Chart zu kleistern Das nervige Label mit den Pivotwerten habe ich schon auskommentiert bekommen. Da ich gerade mit mehreren Berechnungsmethoden experimentiere, würde ich den Indi gern mehrfach auf den Chart ziehen um die verschiedenen Ergebnisse darzustellen. Macht er aber leider nicht. Ich vermute mit meinen laienhaften Kenntnissen, dass er im folgenden Abschnitt nach vorhandenen Linien sucht und die erst löscht, bevor er neue bildet: Code:
void DrawLevel(string a_name_0,double ad,int a_style,int Width,color a_color) { double l_price=ad; int l_timeA; int l_timeB; double diff=Period()*60; l_timeA=Time[0] + xShift*diff; l_timeB=Time[0] - (xLen-xShift) * diff; if(ad>0.0) { if(ObjectFind(a_name_0)!=0) { ObjectCreate(a_name_0,OBJ_TREND,0,l_timeA,l_price,l_timeB,l_price); ObjectSet(a_name_0,OBJPROP_RAY,False); ObjectSet(a_name_0,OBJPROP_COLOR,a_color); ObjectSet(a_name_0,OBJPROP_WIDTH,Width); ObjectSet(a_name_0,OBJPROP_STYLE,a_style); ObjectSet(a_name_0,OBJPROP_SELECTABLE,false); ObjectSet(a_name_0,OBJPROP_HIDDEN,true); return; } ObjectSet(a_name_0,OBJPROP_RAY,False); ObjectMove(a_name_0,0,l_timeA,l_price); ObjectMove(a_name_0,1,l_timeB,l_price); ObjectSet(a_name_0,OBJPROP_COLOR,a_color); ObjectSet(a_name_0,OBJPROP_WIDTH,Width); ObjectSet(a_name_0,OBJPROP_STYLE,a_style); ObjectSet(a_name_0,OBJPROP_SELECTABLE,false); ObjectSet(a_name_0,OBJPROP_HIDDEN,true); return; } if(ObjectFind(a_name_0)>=0) ObjectDelete(a_name_0); } Hier noch mal der ganze Code, schon mit dem von mir auskommentierten Label, was ich nichtbrauche Code:
//+------------------------------------------------------------------+ //| ProjectName | //| Copyright 2012, CompanyName | //| http://www.companyname.net | //+------------------------------------------------------------------+ /* Created by Asteris, modified by Cubicrey [March, 2010] Website: http://www.indo-inve*****.com Converted to Pivot Star by rkdius [Dec 2016] */ #property indicator_chart_window //--- input parameters enum mode { Standard, Fibonacci, Camarilla, Woodie, Demark }; enum lbCorner { TopLeft=0, // Top Left TopRight=1, // Top Right BottomLeft=2, // Bottom Left BottomRight=3 // Bottom Right }; extern mode Pmode = Standard; extern ENUM_TIMEFRAMES inpPeriod = PERIOD_H1; // Pivot Period extern int xShift = 3; // X-Axis Shift extern int xLen = 25; // Line Length //extern lbCorner LabelCorner = TopRight; // Label Corner extern color LevelPP = SpringGreen; // Pivot Point extern ENUM_LINE_STYLE StylePP = 0; // Line Style extern int WidthPP = 1; // Line Width extern color LevelR1 = Crimson; // R1 extern ENUM_LINE_STYLE StyleR1 = 2; // Line Style extern int WidthR1 = 1; // Line Width extern color LevelR2 = Crimson; // R2 extern ENUM_LINE_STYLE StyleR2 = 1; // Line Style extern int WidthR2 = 1; // Line Width extern color LevelR3 = Crimson; // R3 extern ENUM_LINE_STYLE StyleR3 = 0; // Line Style extern int WidthR3 = 1; // Line Width extern color LevelS1 = DodgerBlue; // S1 extern ENUM_LINE_STYLE StyleS1 = 2; // Line Style extern int WidthS1 = 1; // Line Width extern color LevelS2 = DodgerBlue; // S2 extern ENUM_LINE_STYLE StyleS2 = 1; // Line Style extern int WidthS2 = 1; // Line Width extern color LevelS3 = DodgerBlue; // S3 extern ENUM_LINE_STYLE StyleS3 = 0; // Line Style extern int WidthS3 = 1; // Line Width extern color LevelYH = MediumVioletRed; // Yesterday's High extern ENUM_LINE_STYLE StyleYH = 2; // Line Style extern int WidthYH = 3; // Line Width extern color LevelYL = MediumSlateBlue; // Yesterday's Low extern ENUM_LINE_STYLE StyleYL = 2; // Line Style extern int WidthYL = 3; // Line Width //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double x,xR1,xR2,xR3,xS1,xS2,xS3,xPP; /*int init() { if (LabelCorner<2) { ObjectMakeLabel("pInfo",10,20); ObjectMakeLabel("lbR3",10,35); ObjectMakeLabel("lbR2",10,50); ObjectMakeLabel("lbR1",10,65); ObjectMakeLabel("lbPP",10,80); ObjectMakeLabel("lbS1",10,95); ObjectMakeLabel("lbS2",10,110); ObjectMakeLabel("lbS3",10,125); } else { ObjectMakeLabel("lbS3",10,20); ObjectMakeLabel("lbS2",10,35); ObjectMakeLabel("lbS1",10,50); ObjectMakeLabel("lbPP",10,65); ObjectMakeLabel("lbR1",10,80); ObjectMakeLabel("lbR2",10,95); ObjectMakeLabel("lbR3",10,110); ObjectMakeLabel("pInfo",10,125); } return (0); }*/ //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int deinit() { DrawLevel("R3",0,StyleR3,WidthR3,LevelR3); DrawLevel("R2",0,StyleR2,WidthR2,LevelR2); DrawLevel("R1",0,StyleR1,WidthR1,LevelR1); DrawLevel("PP",0,StylePP,WidthPP,LevelPP); DrawLevel("S1",0,StyleS1,WidthS1,LevelS1); DrawLevel("S2",0,StyleS2,WidthS2,LevelS2); DrawLevel("S3",0,StyleS3,WidthS3,LevelS3); DrawLevel("Yesterdays High",0,StyleYH,WidthYH,LevelYH); DrawLevel("Yesterdays Low",0,StyleYL,WidthYL,LevelYL); ObjectDelete("pInfo"); ObjectDelete("lbR3"); ObjectDelete("lbR2"); ObjectDelete("lbR1"); ObjectDelete("lbPP"); ObjectDelete("lbS1"); ObjectDelete("lbS2"); ObjectDelete("lbS3"); return (0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { //--- Yesterday's High/Low double xYH = iHigh(0 ,PERIOD_D1,1); double xYL = iLow(0 ,PERIOD_D1,1); //--- Pivot Points double xOpen=iOpen(0,inpPeriod,1); double xClose= iClose(0,inpPeriod,1); double xHigh = iHigh(0,inpPeriod,1); double xLow= iLow(0,inpPeriod,1); xPP =(xHigh+xLow+xClose)/3; double xRange=xHigh-xLow; //--- Standard Pivot if(Pmode==Standard) { xR1 = (2 * xPP) - xLow; xS1 = (2 * xPP) - xHigh; xR2 = xPP + xRange; xS2 = xPP - xRange; xR3 = xHigh + 2*(xPP - xLow); xS3 = xLow - 2*(xHigh - xPP); } //--- Fibonacci's Pivot else if(Pmode==Fibonacci) { xR1 = xPP + 0.382 * xRange; xR2 = xPP + 0.618 * xRange; xR3 = xPP + 1.000 * xRange; xS1 = xPP - 0.382 * xRange; xS2 = xPP - 0.618 * xRange; xS3 = xPP - 1.000 * xRange; } //--- Camarilla Pivot else if(Pmode==Camarilla) { xR1 = xClose + (0.275 * xRange); // H3 Short xR2 = xClose + (0.55 * xRange); // H4 Long Breakout xR3 = (xHigh / xLow) * xClose; // H5 LB Target xS1 = xClose - (0.275 * xRange); // L3 Long xS2 = xClose - (0.55 * xRange); // L4 Short Breakout xS3 = xClose - (xR3 - xClose); // L5 SB Target } //--- Woodie's Pivot else if(Pmode==Woodie) { xPP = (xHigh + xLow + 2*xClose)/4; xR1 = 2*xPP - xLow; xR2 = xPP + xRange; xR3=0; // Not used xS1 = 2*xPP - xHigh; xS2 = xPP - xRange; xS3=0; // Not used } //--- Demark Pivot else if(Pmode==Demark) { if(xClose<xOpen) x = xHigh + (2*xLow) + xClose; if(xClose>xOpen) x = (2*xHigh) + xLow + xClose; if(xClose==xOpen) x=xHigh+xLow+(2*xClose); xPP=0; // Not used xR3 = x / 2 - xLow; xS3 = x / 2 - xHigh; xR1=0; // R1, R2, S1 and S2 Not used xR2 = 0; xS1 = 0; xS2 = 0; } //--- /* Comment("R3 = "+DoubleToStr(xR3,5) +"\nR2 = "+DoubleToStr(xR2,5) +"\nR1 = "+DoubleToStr(xR1,5) +"\nPP = "+DoubleToStr(xPP,5) +"\nS1 = "+DoubleToStr(xS1,5) +"\nS2 = "+DoubleToStr(xS2,5) +"\nS3 = "+DoubleToStr(xS3,5)); */ //--- Draw Lines if(inpPeriod>Period()) { if(Period()<=1440) { DrawLevel("Yesterdays High",xYH,StyleYH,WidthYH,LevelYH); DrawLevel("Yesterdays Low",xYL,StyleYL,WidthYL,LevelYL); } DrawLevel("R3",xR3,StyleR3,WidthR3,LevelR3); DrawLevel("R2",xR2,StyleR2,WidthR2,LevelR2); DrawLevel("R1",xR1,StyleR1,WidthR1,LevelR1); DrawLevel("PP",xPP,StylePP,WidthPP,LevelPP); DrawLevel("S1",xS1,StyleS1,WidthS1,LevelS1); DrawLevel("S2",xS2,StyleS2,WidthS2,LevelS2); DrawLevel("S3",xS3,StyleS3,WidthS3,LevelS3); } DisplayMode(); return (0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void DrawLevel(string a_name_0,double ad,int a_style,int Width,color a_color) { double l_price=ad; int l_timeA; int l_timeB; double diff=Period()*60; l_timeA=Time[0] + xShift*diff; l_timeB=Time[0] - (xLen-xShift) * diff; if(ad>0.0) { if(ObjectFind(a_name_0)!=0) { ObjectCreate(a_name_0,OBJ_TREND,0,l_timeA,l_price,l_timeB,l_price); ObjectSet(a_name_0,OBJPROP_RAY,False); ObjectSet(a_name_0,OBJPROP_COLOR,a_color); ObjectSet(a_name_0,OBJPROP_WIDTH,Width); ObjectSet(a_name_0,OBJPROP_STYLE,a_style); ObjectSet(a_name_0,OBJPROP_SELECTABLE,false); ObjectSet(a_name_0,OBJPROP_HIDDEN,true); return; } ObjectSet(a_name_0,OBJPROP_RAY,False); ObjectMove(a_name_0,0,l_timeA,l_price); ObjectMove(a_name_0,1,l_timeB,l_price); ObjectSet(a_name_0,OBJPROP_COLOR,a_color); ObjectSet(a_name_0,OBJPROP_WIDTH,Width); ObjectSet(a_name_0,OBJPROP_STYLE,a_style); ObjectSet(a_name_0,OBJPROP_SELECTABLE,false); ObjectSet(a_name_0,OBJPROP_HIDDEN,true); return; } if(ObjectFind(a_name_0)>=0) ObjectDelete(a_name_0); } //+--------------------------------------------------------------------------+ //| ObjectMakeLabel: | //| P4L Clock.mq4 | //| New rewrite by: Pips4life, a user at forexfactory.com | //| 2014-Mar-19: v2_12 P4L Clock.mq4 | //| For lastest version: http://www.forexfactory.com/showthread.php?t=109305 | //| Previous names: Clock_v1_3.mq4, Clock.mq4, ... | //| Previous version: Jerome, 4xCoder@gmail.com, ... | ///+-------------------------------------------------------------------------+ /*int ObjectMakeLabel( string n, int xoff, int yoff ) { if (!WindowIsVisible(0)) return(-1); ObjectCreate( n, OBJ_LABEL, 0, 0, 0 ); ObjectSet( n, OBJPROP_CORNER, LabelCorner ); ObjectSet( n, OBJPROP_XDISTANCE, xoff ); ObjectSet( n, OBJPROP_YDISTANCE, yoff ); ObjectSet( n, OBJPROP_BACK, false ); ObjectSet( n, OBJPROP_SELECTABLE, false); ObjectSet( n, OBJPROP_HIDDEN, true); return(0); }// end of ObjectMakeLabel*/ void DisplayMode() { string pivPeriod = "M"+IntegerToString(inpPeriod); if (inpPeriod>=60) pivPeriod = "H"+IntegerToString(inpPeriod/60); if (inpPeriod>=1440) pivPeriod = "D1"; if (inpPeriod>=10080) pivPeriod = "WK"; if (inpPeriod>=43200) pivPeriod = "MN"; string pivInfo = EnumToString(Pmode)+" ("+pivPeriod+")"; ObjectSetText( "pInfo", pivInfo, 8, "Arial", Black); ObjectSetText( "lbR3", "R3 = "+DoubleToStr(xR3,Digits), 8, "Arial", LevelR3); ObjectSetText( "lbR2", "R2 = "+DoubleToStr(xR2,Digits), 8, "Arial", LevelR2); ObjectSetText( "lbR1", "R1 = "+DoubleToStr(xR1,Digits), 8, "Arial", LevelR1); ObjectSetText( "lbPP", "PP = "+DoubleToStr(xPP,Digits), 8, "Arial", LevelPP); ObjectSetText( "lbS1", "S1 = "+DoubleToStr(xS1,Digits), 8, "Arial", LevelS1); ObjectSetText( "lbS2", "S2 = "+DoubleToStr(xS2,Digits), 8, "Arial", LevelS2); ObjectSetText( "lbS3", "S3 = "+DoubleToStr(xS3,Digits), 8, "Arial", LevelS3); } Und lerning by doing ist für mich einfach die beste Methode. Danke schon mal für Eure Geduld. |
|
|||
Du musst im Namen der Objekte, welche über DrawLevel() gezeichnet werden einen unverwechselbaren Zusatz definieren.
Also z.B. bei DrawLevel("R3"+Number,xR3,StyleR3,WidthR3,LevelR3); Diese Variable Number muss in den externen Variablen definiert werden, z.B. mit 100: extern string Number = 100; Für jeden Indikator, den Du auf das Chart ziehst, wird eine andere Zahl vergeben. Und überall, wo dieser Objektname "R3" auftaucht, muss der durch "R3"+Number ersetzt werden usw. traderdoc
__________________
Ich erfülle Euch gern Eure EA-, Indikator- und Script-Programmierungswünsche auf Honorarbasis. |
|
|||
Danke Doc -ich hoffe Du verzeihst die Abkürzung ;-)
Ich probier das nachher gleich mal und erstatte Bericht. Ev. ist das Ergebnis ja dann auch für andere interessant. |
|
|||
Dank Doc sieht das nun so aus und klappt genau so, wie ich es wollte:
Code:
//+------------------------------------------------------------------+ //| ProjectName | //| Copyright 2012, CompanyName | //| http://www.companyname.net | //+------------------------------------------------------------------+ /* Created by Asteris, modified by Cubicrey [March, 2010] Website: http://www.indo-inve*****.com Converted to Pivot Star by rkdius [Dec 2016] */ #property indicator_chart_window //--- input parameters enum mode { Standard, Fibonacci, Camarilla, Woodie, Demark }; enum lbCorner { TopLeft=0, // Top Left TopRight=1, // Top Right BottomLeft=2, // Bottom Left BottomRight=3 // Bottom Right }; extern string Number = 1; extern mode Pmode = Standard; extern ENUM_TIMEFRAMES inpPeriod = PERIOD_H1; // Pivot Period extern int xShift = 3; // X-Axis Shift extern int xLen = 25; // Line Length //extern lbCorner LabelCorner = TopRight; // Label Corner extern color LevelPP = LightGray; // Pivot Point extern ENUM_LINE_STYLE StylePP = 0; // Line Style extern int WidthPP = 1; // Line Width extern color LevelR1 = Orange; // R1 extern ENUM_LINE_STYLE StyleR1 = 0; // Line Style extern int WidthR1 = 1; // Line Width extern color LevelR2 = Red; // R2 extern ENUM_LINE_STYLE StyleR2 = 0; // Line Style extern int WidthR2 = 1; // Line Width extern color LevelR3 = Magenta; // R3 extern ENUM_LINE_STYLE StyleR3 = 0; // Line Style extern int WidthR3 = 1; // Line Width extern color LevelS1 = GreenYellow; // S1 extern ENUM_LINE_STYLE StyleS1 = 0; // Line Style extern int WidthS1 = 1; // Line Width extern color LevelS2 = Lime; // S2 extern ENUM_LINE_STYLE StyleS2 = 0; // Line Style extern int WidthS2 = 1; // Line Width extern color LevelS3 = Green; // S3 extern ENUM_LINE_STYLE StyleS3 = 0; // Line Style extern int WidthS3 = 1; // Line Width extern color LevelYH = MediumVioletRed; // Yesterday's High extern ENUM_LINE_STYLE StyleYH = 2; // Line Style extern int WidthYH = 1; // Line Width extern color LevelYL = DarkGreen; // Yesterday's Low extern ENUM_LINE_STYLE StyleYL = 2; // Line Style extern int WidthYL = 1; // Line Width //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ double x,xR1,xR2,xR3,xS1,xS2,xS3,xPP; /*int init() { if (LabelCorner<2) { ObjectMakeLabel("pInfo",10,20); ObjectMakeLabel("lbR3",10,35); ObjectMakeLabel("lbR2",10,50); ObjectMakeLabel("lbR1",10,65); ObjectMakeLabel("lbPP",10,80); ObjectMakeLabel("lbS1",10,95); ObjectMakeLabel("lbS2",10,110); ObjectMakeLabel("lbS3",10,125); } else { ObjectMakeLabel("lbS3",10,20); ObjectMakeLabel("lbS2",10,35); ObjectMakeLabel("lbS1",10,50); ObjectMakeLabel("lbPP",10,65); ObjectMakeLabel("lbR1",10,80); ObjectMakeLabel("lbR2",10,95); ObjectMakeLabel("lbR3",10,110); ObjectMakeLabel("pInfo",10,125); } return (0); }*/ //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int deinit() { DrawLevel("R3"+Number,0,StyleR3,WidthR3,LevelR3); DrawLevel("R2"+Number,0,StyleR2,WidthR2,LevelR2); DrawLevel("R1"+Number,0,StyleR1,WidthR1,LevelR1); DrawLevel("PP"+Number,0,StylePP,WidthPP,LevelPP); DrawLevel("S1"+Number,0,StyleS1,WidthS1,LevelS1); DrawLevel("S2"+Number,0,StyleS2,WidthS2,LevelS2); DrawLevel("S3"+Number,0,StyleS3,WidthS3,LevelS3); DrawLevel("Yesterdays High",0,StyleYH,WidthYH,LevelYH); DrawLevel("Yesterdays Low",0,StyleYL,WidthYL,LevelYL); ObjectDelete("pInfo"); ObjectDelete("lbR3"); ObjectDelete("lbR2"); ObjectDelete("lbR1"); ObjectDelete("lbPP"); ObjectDelete("lbS1"); ObjectDelete("lbS2"); ObjectDelete("lbS3"); return (0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { //--- Yesterday's High/Low double xYH = iHigh(0 ,PERIOD_D1,1); double xYL = iLow(0 ,PERIOD_D1,1); //--- Pivot Points double xOpen=iOpen(0,inpPeriod,1); double xClose= iClose(0,inpPeriod,1); double xHigh = iHigh(0,inpPeriod,1); double xLow= iLow(0,inpPeriod,1); xPP =(xHigh+xLow+xClose)/3; double xRange=xHigh-xLow; //--- Standard Pivot if(Pmode==Standard) { xR1 = (2 * xPP) - xLow; xS1 = (2 * xPP) - xHigh; xR2 = xPP + xRange; xS2 = xPP - xRange; xR3 = xHigh + 2*(xPP - xLow); xS3 = xLow - 2*(xHigh - xPP); } //--- Fibonacci's Pivot else if(Pmode==Fibonacci) { xR1 = xPP + 0.382 * xRange; xR2 = xPP + 0.618 * xRange; xR3 = xPP + 1.000 * xRange; xS1 = xPP - 0.382 * xRange; xS2 = xPP - 0.618 * xRange; xS3 = xPP - 1.000 * xRange; } //--- Camarilla Pivot else if(Pmode==Camarilla) { xR1 = xClose + (0.275 * xRange); // H3 Short xR2 = xClose + (0.55 * xRange); // H4 Long Breakout xR3 = (xHigh / xLow) * xClose; // H5 LB Target xS1 = xClose - (0.275 * xRange); // L3 Long xS2 = xClose - (0.55 * xRange); // L4 Short Breakout xS3 = xClose - (xR3 - xClose); // L5 SB Target } //--- Woodie's Pivot else if(Pmode==Woodie) { xPP = (xHigh + xLow + 2*xClose)/4; xR1 = 2*xPP - xLow; xR2 = xPP + xRange; xR3=0; // Not used xS1 = 2*xPP - xHigh; xS2 = xPP - xRange; xS3=0; // Not used } //--- Demark Pivot else if(Pmode==Demark) { if(xClose<xOpen) x = xHigh + (2*xLow) + xClose; if(xClose>xOpen) x = (2*xHigh) + xLow + xClose; if(xClose==xOpen) x=xHigh+xLow+(2*xClose); xPP=0; // Not used xR3 = x / 2 - xLow; xS3 = x / 2 - xHigh; xR1=0; // R1, R2, S1 and S2 Not used xR2 = 0; xS1 = 0; xS2 = 0; } //--- /* Comment("R3 = "+DoubleToStr(xR3,5) +"\nR2 = "+DoubleToStr(xR2,5) +"\nR1 = "+DoubleToStr(xR1,5) +"\nPP = "+DoubleToStr(xPP,5) +"\nS1 = "+DoubleToStr(xS1,5) +"\nS2 = "+DoubleToStr(xS2,5) +"\nS3 = "+DoubleToStr(xS3,5)); */ //--- Draw Lines if(inpPeriod>Period()) { if(Period()<=1440) { DrawLevel("Yesterdays High",xYH,StyleYH,WidthYH,LevelYH); DrawLevel("Yesterdays Low",xYL,StyleYL,WidthYL,LevelYL); } DrawLevel("R3"+Number,xR3,StyleR3,WidthR3,LevelR3); DrawLevel("R2"+Number,xR2,StyleR2,WidthR2,LevelR2); DrawLevel("R1"+Number,xR1,StyleR1,WidthR1,LevelR1); DrawLevel("PP"+Number,xPP,StylePP,WidthPP,LevelPP); DrawLevel("S1"+Number,xS1,StyleS1,WidthS1,LevelS1); DrawLevel("S2"+Number,xS2,StyleS2,WidthS2,LevelS2); DrawLevel("S3"+Number,xS3,StyleS3,WidthS3,LevelS3); } DisplayMode(); return (0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ void DrawLevel(string a_name_0,double ad,int a_style,int Width,color a_color) { double l_price=ad; int l_timeA; int l_timeB; double diff=Period()*60; l_timeA=Time[0] + xShift*diff; l_timeB=Time[0] - (xLen-xShift) * diff; if(ad>0.0) { if(ObjectFind(a_name_0)!=0) { ObjectCreate(a_name_0,OBJ_TREND,0,l_timeA,l_price,l_timeB,l_price); ObjectSet(a_name_0,OBJPROP_RAY,False); ObjectSet(a_name_0,OBJPROP_COLOR,a_color); ObjectSet(a_name_0,OBJPROP_WIDTH,Width); ObjectSet(a_name_0,OBJPROP_STYLE,a_style); ObjectSet(a_name_0,OBJPROP_SELECTABLE,false); ObjectSet(a_name_0,OBJPROP_HIDDEN,true); return; } ObjectSet(a_name_0,OBJPROP_RAY,False); ObjectMove(a_name_0,0,l_timeA,l_price); ObjectMove(a_name_0,1,l_timeB,l_price); ObjectSet(a_name_0,OBJPROP_COLOR,a_color); ObjectSet(a_name_0,OBJPROP_WIDTH,Width); ObjectSet(a_name_0,OBJPROP_STYLE,a_style); ObjectSet(a_name_0,OBJPROP_SELECTABLE,false); ObjectSet(a_name_0,OBJPROP_HIDDEN,true); return; } if(ObjectFind(a_name_0)>=0) ObjectDelete(a_name_0); } //+--------------------------------------------------------------------------+ //| ObjectMakeLabel: | //| P4L Clock.mq4 | //| New rewrite by: Pips4life, a user at forexfactory.com | //| 2014-Mar-19: v2_12 P4L Clock.mq4 | //| For lastest version: http://www.forexfactory.com/showthread.php?t=109305 | //| Previous names: Clock_v1_3.mq4, Clock.mq4, ... | //| Previous version: Jerome, 4xCoder@gmail.com, ... | ///+-------------------------------------------------------------------------+ /*int ObjectMakeLabel( string n, int xoff, int yoff ) { if (!WindowIsVisible(0)) return(-1); ObjectCreate( n, OBJ_LABEL, 0, 0, 0 ); ObjectSet( n, OBJPROP_CORNER, LabelCorner ); ObjectSet( n, OBJPROP_XDISTANCE, xoff ); ObjectSet( n, OBJPROP_YDISTANCE, yoff ); ObjectSet( n, OBJPROP_BACK, false ); ObjectSet( n, OBJPROP_SELECTABLE, false); ObjectSet( n, OBJPROP_HIDDEN, true); return(0); }// end of ObjectMakeLabel*/ void DisplayMode() { string pivPeriod = "M"+IntegerToString(inpPeriod); if (inpPeriod>=60) pivPeriod = "H"+IntegerToString(inpPeriod/60); if (inpPeriod>=1440) pivPeriod = "D1"; if (inpPeriod>=10080) pivPeriod = "WK"; if (inpPeriod>=43200) pivPeriod = "MN"; string pivInfo = EnumToString(Pmode)+" ("+pivPeriod+")"; ObjectSetText( "pInfo", pivInfo, 8, "Arial", Black); ObjectSetText( "lbR3", "R3 = "+DoubleToStr(xR3,Digits), 8, "Arial", LevelR3); ObjectSetText( "lbR2", "R2 = "+DoubleToStr(xR2,Digits), 8, "Arial", LevelR2); ObjectSetText( "lbR1", "R1 = "+DoubleToStr(xR1,Digits), 8, "Arial", LevelR1); ObjectSetText( "lbPP", "PP = "+DoubleToStr(xPP,Digits), 8, "Arial", LevelPP); ObjectSetText( "lbS1", "S1 = "+DoubleToStr(xS1,Digits), 8, "Arial", LevelS1); ObjectSetText( "lbS2", "S2 = "+DoubleToStr(xS2,Digits), 8, "Arial", LevelS2); ObjectSetText( "lbS3", "S3 = "+DoubleToStr(xS3,Digits), 8, "Arial", LevelS3); } An der Stelle noch einmal ein herzliches Dankeschön an traderdoc. |
Lesezeichen |
Themen-Optionen | Thema durchsuchen |
Ansicht | |
|
|