Can we use the standard library in script? I'm trying to create rectangle using script and the library but nothing happen. Got no problem using ObjectCreate.
#property strict#include <ChartObjects\ChartObjectsShapes.mqh>
CChartObjectRectangle try;
//+------------------------------------------------------------------+//| Script program start function |//+------------------------------------------------------------------+voidOnStart()
{
//---
try.Create(ChartID(),"scriptbox",0,0,0,0,0);
}
//+------------------------------------------------------------------+
When I run the script, the rectangle is not in Object List (Ctrl+B).
But when I do it using Indicator,
#property strict#property indicator_chart_window#include <ChartObjects\ChartObjectsShapes.mqh>
CChartObjectRectangle try;
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intOnInit()
{
//--- indicator buffers mapping//---return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,
constint prev_calculated,
constdatetime &time[],
constdouble &open[],
constdouble &high[],
constdouble &low[],
constdouble &close[],
constlong &tick_volume[],
constlong &volume[],
constint &spread[])
{
//---if(prev_calculated==0)
{
try.Create(ChartID(),"boxtry",0,0,0,0,0);
}
//--- return value of prev_calculated for next callreturn(rates_total);
}
the rectangle is there in the object list.
I remember reading one of the advantages using the library when creating objects is that the object is deleted when the Indicator/EA is removed.
Does this mean that when the script is removed (automatically after completion), the rectangle is also removed?
Hi,
Can we use the standard library in script? I'm trying to create rectangle using script and the library but nothing happen. Got no problem using ObjectCreate.
When I run the script, the rectangle is not in Object List (Ctrl+B).
But when I do it using Indicator,
the rectangle is there in the object list.
I remember reading one of the advantages using the library when creating objects is that the object is deleted when the Indicator/EA is removed.
Does this mean that when the script is removed (automatically after completion), the rectangle is also removed?