use lines pitchfork to do what. see it we can buy or sell in market , can we. thanks share
that's a little part of my strategy. ( i working on it )
i want that :
with use this method to draw pitchfork ; the level line dose not appear on chart.
is it possible ?
For create Triangle you can use below code:
void CreateTRIANGLE(int chart_id, // Chart identifier
string name, // object name
// Chart window
datetime time1, // First time coordinate
double price1, // First price coordinate
datetime time2, // Second time coordinate
double price2, // Second price coordinate
datetime time3, // Third time coordinate
double price3, // Third price coordinate
color Color=clrGreenYellow, // Fill color
int style=STYLE_SOLID, // line style
int width=1 // line width
)
{
ObjectCreate(chart_id,name, OBJ_TRIANGLE, 0, 0,0);
ObjectSetInteger(chart_id,name,OBJPROP_COLOR,Color);
ObjectSetInteger(chart_id,name,OBJPROP_STYLE,style);
ObjectSetInteger(chart_id,name,OBJPROP_WIDTH,width);
ObjectSetInteger(chart_id,name,OBJPROP_TIME,time1);
ObjectSetInteger(chart_id,name,OBJPROP_TIME,1,time2);
ObjectSetInteger(chart_id,name,OBJPROP_TIME,2,time3);
ObjectSetInteger(chart_id,name,OBJPROP_FILL,1);
ObjectSetDouble(chart_id,name,OBJPROP_PRICE,price1);
ObjectSetDouble(chart_id,name,OBJPROP_PRICE,1,price2);
ObjectSetDouble(chart_id,name,OBJPROP_PRICE,2,price3);
}
i used bellow line to draw pitchfork .
as you see in picture below, level line also draw with it.
how can set it to undo like this, ( do not draw level lines )
thank you.
Hi mehrdad
This syntax for create object is not correct
ObjectCreate(chart_id_Pitchfork,name_Pitchfork,OBJ_PITCHFORK,nwin_Pitchfork,time1_Pitchfork,price1_Pitchfork ,time2_Pitchfork,price2_Pitchfork,time3_Pitchfork,price3_Pitchfork);
This syntax for create object
bool ObjectCreate(
long chart_id, // chart identifier
string name, // object name
ENUM_OBJECT type, // object type
sub_window nwin, // window index
datetime time1, // time of the first anchor point
double price1, // price of the first anchor point
...
datetime timeN=0, // time of the N-th anchor point
double priceN=0, // price of the N-th anchor point
...
datetime time30=0, // time of the 30th anchor point
double price30=0 // price of the 30th anchor point
);
For more information, please visit this page : https://www.mql5.com/en/docs/objects/objectcreate
![Documentation on MQL5: Object Functions / ObjectCreate Documentation on MQL5: Object Functions / ObjectCreate](/i/community/logo_mql5_small.png)
- www.mql5.com
And This code for PITCHFORK
void CreateFork(int chart_id, // Chart identifier
string name, // object name
datetime time1, // First time coordinate
double price1, // First price coordinate
datetime time2, // Second time coordinate
double price2, // Second price coordinate
datetime time3, // Third time coordinate
double price3, // Third price coordinate
int level=0, // Level number
color Color=clrGreenYellow, // line color
int style=STYLE_SOLID, // line style
int width=1 // line width
)
{
ObjectCreate(chart_id,name, OBJ_PITCHFORK, 0, 0,0);
ObjectSetInteger(chart_id,name,OBJPROP_COLOR,Color);
ObjectSetInteger(chart_id,name,OBJPROP_STYLE,style);
ObjectSetInteger(chart_id,name,OBJPROP_WIDTH,width);
ObjectSetInteger(chart_id,name,OBJPROP_TIME,time1);
ObjectSetInteger(chart_id,name,OBJPROP_TIME,1,time2);
ObjectSetInteger(chart_id,name,OBJPROP_TIME,2,time3);
ObjectSetInteger(chart_id,name,OBJPROP_FILL,1);
ObjectSetDouble(chart_id,name,OBJPROP_PRICE,price1);
ObjectSetDouble(chart_id,name,OBJPROP_PRICE,1,price2);
ObjectSetDouble(chart_id,name,OBJPROP_PRICE,2,price3);
ObjectSetInteger(chart_id,name,OBJPROP_LEVELS,level);
}
And Final code
kourosh1347, thank you for helping TIMisthebest
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
i used bellow line to draw pitchfork .
as you see in picture below, level line also draw with it.
how can set it to undo like this, ( do not draw level lines )
thank you.