Hello, how are you? currently my indicator it does the following
I drag an object to a candle and plots a vwap
I’m trying to change this to
1 ° Click on the object
2 ° Click on the candle = [Vwap was inserted]
3 ° Click object again = [Vwap removed]
But I can not build this structure, can anyone help me?
Code:
void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam)
{
int x,y,i;
datetime tm;
double pr;
int subW=0;
if(id==CHARTEVENT_OBJECT_DRAG)
{
for( i=0; i<4; i++)
{
if( sparam==ObjNames[i] )
{
IsMoveStarted[i]=true;
x=(int)ObjectGetInteger(ChartID(),sparam,OBJPROP_XDISTANCE);
y=(int)ObjectGetInteger(ChartID(),sparam,OBJPROP_YDISTANCE);
ChartXYToTimePrice(ChartID(),x,y,subW,tm,pr);
BoxTimes[i]=tm;
BoxPrices[i]=pr;
{
}