Hi,
I would like to create in the indicator a line that follows a calculated volume and that changes color (red when sell and green when buy). I
tried with OBJ_TREND but I get a straight line (probably combining only two values)
//primo puntodatetime t1=Time[0];
double p1=Point*100+Open[0];
//secondo puntodatetime t2=Time[5000];
double p2=Point*100+Open[1];
//--- creazione prima parte trendlineif(!ObjectCreate(obj_name,OBJ_TREND,0,t1,p1,t2,p2))
{
Print("errore creazione trendline! codice #",GetLastError());
return(0);
}
//--- colore rossoObjectSetInteger(current_chart_id,obj_name,OBJPROP_COLOR,clrRed);
for(int i=1; i<100000; i++)
{
t2=Time[i];
p2=Close[i];
//--- move the 2nd anchor point of the trend lineObjectMove(obj_name,1,t2,p2);
//--- forced chart redrawChartRedraw(current_chart_id);
Sleep(100);
}
//--- sleep to see the objectSleep(3000);
//--- delete objectObjectDelete(obj_name);
return(0);
}
After draw line problem is solved I need If price is up or down to iMA(Symbol(),0,10,0,MODE_EMA,PRICE_CLOSE,i) the line has green or red
color. Thank you
Hi, I would like to create in the indicator a line that follows a calculated volume and that changes color (red when sell and green when buy). I tried with OBJ_TREND but I get a straight line (probably combining only two values)
After draw line problem is solved I need If price is up or down to iMA(Symbol(),0,10,0,MODE_EMA,PRICE_CLOSE,i) the line has green or red color. Thank you