Can anyone give me a ObjectCreate sample? I create one and it doesn't work. Thanks. - page 2

 
almo1010:

How can I add that backtesting connect line to my EA?

Draw a TrendLine between the open datetime and price and the close datetime and price
 
Ah, I got ya. Color code the ones that make it to Send and Close. Cool!
 
RaptorUK:
Draw a TrendLine between the open datetime and price and the close datetime and price

Yep, I kinda know what to do. Set the Ray property to false, assign some variables for those you mention,

then ObjectCreate() to draw it. I have the psuedo-code concept. So, I just wonder, since it is done in the backtest,

is there a function or an example of "how" it is done? The simple elegant solution?

 
//+------------------------------------------------------------------+
void Trend_Line(string label,datetime x1, datetime x2, double y1, 
                            double y2, color lineColor, double style, int width)
   {
    ObjectDelete(label);
    ObjectCreate(label, OBJ_TREND, 0, x1, y1, x2, y2, 0, 0);
    ObjectSet(label, OBJPROP_RAY, 0);
    ObjectSet(label, OBJPROP_COLOR, lineColor);
    ObjectSet(label, OBJPROP_STYLE, style);
    ObjectSet(label, OBJPROP_WIDTH, width);
   }
//+------------------------------------------------------------------+

label name trendline can be something like "trend"+doubletostr(orderticket())

x1 orderopentime

x2 orderclosetime

y1 orderopenprice

y2 ordercloseprice

style 0 = solid

width 0 = thin

Something like this you mean ??

 
almo1010:

Yep, I kinda know what to do. Set the Ray property to false, assign some variables for those you mention,

then ObjectCreate() to draw it. I have the psuedo-code concept. So, I just wonder, since it is done in the backtest,

is there a function or an example of "how" it is done? The simple elegant solution?

The function is ObjectCreate(), what could be more simple ?
 

Oh, well, for me, coding has always been more simple, the second time. :)

I was wondering if there was a custom function like ConnectOpenClose() or something that, the backtester uses, that's all.

And I was trying it and keep messing up my global vs local variables. Very new to mql4, but not Java in an IDE, for example.

It is simple object concept and more simple now. Thanks. I appreciate the time you took.

I'm still looking for a simple de-bugger. Any ideas?

 
almo1010:

I'm still looking for a simple de-bugger. Any ideas?

A debugger for MT4 ? Print(), Comment(), Alert(), tester log and the Strategy Tester ;-)
 
MetaEditor ==> Compile
 
Yep. Roger that.