Download MetaTrader 5

Learning to draw lines... the new way

To add comments, please log in or register
Michael
718
Michael  

Ok.  I'm trying to learn how to draw lines using the classes provided by MQL4.  I put this in a script to attempt to just draw a simple line.  But when I drop it on the chart, I don't get an object created. 

Can someone show me what I'm doing wrong?

#property strict
#include <ChartObjects\ChartObjectsLines.mqh>

CChartObjectVLine myVLine;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   myVLine.Create(ChartID(),"tester",0,Time[3]);
   myVLine.Color(clrYellow);
  }
Before anyone asks, yes this is not the final product I'm trying to create.  I want to LEARN first, then create.
Michael
718
Michael  
Really?  Not even anyone from Metaquotes can answer this?
Michael
718
Michael  
Ok.  So you can't create objects in a script anymore.  Thanks for the info.
To add comments, please log in or register