mql4 help
Moderator: moderators
- forexjake80
- rank: 50+ posts
- Posts: 137
- Joined: Sun Nov 15, 2009 12:20 pm
- Reputation: 0
- Gender:
mql4 help
I wanna draw a horizontal line in a given time period... can anyone help me with that? Best thing i could come up with so far is a OBJ_TREND with 2x the same price.
It's time to kick ass and chew bubble gum. And I'm all out of gum.
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.
-
- rank: 150+ posts
- Posts: 364
- Joined: Mon Nov 15, 2010 4:19 pm
- Reputation: 0
- Gender:
Take this :
void DrawHLine(string objname,string objLabel, double LinePrice, color LineColor, int styleno, datetime myStartTime,datetime myEndTime, int thicknessCtrl, int RayCtrl)
{
string linename = objname+"HLine";
string lblname = objname+"HLineLbl";
ObjectDelete(linename);
ObjectCreate(linename, OBJ_TREND, 0, myStartTime, LinePrice, myEndTime, LinePrice);
ObjectSet(linename, OBJPROP_COLOR, LineColor );
ObjectSet(linename, OBJPROP_RAY, RayCtrl );
ObjectSet(linename, OBJPROP_WIDTH, thicknessCtrl );
ObjectSet(linename,OBJPROP_STYLE,styleno);
ObjectDelete(lblname);
ObjectCreate(lblname, OBJ_TEXT, 0, myEndTime + (myStartTime-myEndTime)/2, LinePrice);
ObjectSetText(lblname, objLabel, myFontSize, myFont, LineColor);
}
Usage Example :
DrawHLine("PsychLine"," Psych Line ", PsychLinePrice, PsychLineColor, 0 , Time[1000],Time[0],1,0);
void DrawHLine(string objname,string objLabel, double LinePrice, color LineColor, int styleno, datetime myStartTime,datetime myEndTime, int thicknessCtrl, int RayCtrl)
{
string linename = objname+"HLine";
string lblname = objname+"HLineLbl";
ObjectDelete(linename);
ObjectCreate(linename, OBJ_TREND, 0, myStartTime, LinePrice, myEndTime, LinePrice);
ObjectSet(linename, OBJPROP_COLOR, LineColor );
ObjectSet(linename, OBJPROP_RAY, RayCtrl );
ObjectSet(linename, OBJPROP_WIDTH, thicknessCtrl );
ObjectSet(linename,OBJPROP_STYLE,styleno);
ObjectDelete(lblname);
ObjectCreate(lblname, OBJ_TEXT, 0, myEndTime + (myStartTime-myEndTime)/2, LinePrice);
ObjectSetText(lblname, objLabel, myFontSize, myFont, LineColor);
}
Usage Example :
DrawHLine("PsychLine"," Psych Line ", PsychLinePrice, PsychLineColor, 0 , Time[1000],Time[0],1,0);
- forexjake80
- rank: 50+ posts
- Posts: 137
- Joined: Sun Nov 15, 2009 12:20 pm
- Reputation: 0
- Gender:
-
- rank: 150+ posts
- Posts: 364
- Joined: Mon Nov 15, 2010 4:19 pm
- Reputation: 0
- Gender:
Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.
Thank you for your support.