Attachments forums

List of attachments posted on this forum.


All files on forums: 163211

Re: Coding Help

kysbog, Wed Nov 06, 2024 12:06 pm

Lwqa wrote: Tue Nov 05, 2024 11:59 pm Dear Mr Tools ,

I think this is the last puzzle piece so that I can improve in Trading, I love this Business.

I am asking you if it is possible to create an indicator that draws a vertical line in D1 on a particular date. By zooming in to Low Time Frame, the whole day is marked by a color on the font.

With respect, I hope this little hint gives you inspiration :

int lookBack = 100; // no of days you wanna look back
for(int i=100;i>=0;i--)
{
datetime dailyTime=iTime(Symbol(),1440,i);
string name=TimeToStr(dailyTime)+" Time_Vertical_Line";
if(TimeDay(dailyTime)==14 && ObjectFind(0,name)<0)
{
if(!ObjectCreate(0,name,OBJ_VLINE,0,dailyTime,0))
Print("Fail to draw the line ERROR CODE : ",GetLastError());
ObjectSet(name,OBJPROP_WIDTH,width);
ObjectSet(name,OBJPROP_COLOR,Color);
ObjectSet(name,OBJPROP_BACK,true);
}
}


Thank you always for your help!
Like this?
All files in topic