[c++] Object Create obj_Text not working

How to create strategies and indicators
Message
Author
dazamate
Posts: 2
Joined: Tue May 30, 2017 3:44 am

[c++] Object Create obj_Text not working

#1 Postby dazamate » Tue May 30, 2017 3:50 am

Hi guys,

I am trying to create a text object that displays the current day of the candle. I have the candle day sorted, but the ObjectCreate() function is not working for me.

Code: Select all

void CreateDayLabel() {
   PrintString("CreateDayLabel() called");
   char* label = "DayLabel";
   
   if( ObjectCreate(label, obj_Text, 0, Time(0), High(0)) ) {
      PrintString("Day label create success, setting object text");
      ObjectSetText(label,"UNSET DAY",16,"Impact",clRed);
   }
   else { PrintString("obj_Text create failed");  }

   // example from help file (not working either)
   PrintString("creating testObj");
   ObjectCreate("testObj", obj_Text, 0, Time(10), Close(0));
   ObjectSetText("testObj", "Test text", 12, "Arial", clYellow);
   ObjectSet("testObj", OBJPROP_VALIGNMENT, tlBottom);
   ObjectSet("testObj", OBJPROP_HALIGNMENT, taLeftJustify);

}


My first ObjectCreate attempt is always returning false, printing the fail statement.

I also copied the example from the help files, which doesn't seem to be working either.

I also tried the obj_TextLabel in the enum, didn't work.

Can anyone see what I am doing wrong?

FX Helper
Posts: 1477
Joined: Mon Apr 01, 2013 3:55 am

Re: [c++] Object Create obj_Text not working

#2 Postby FX Helper » Thu Jun 01, 2017 4:09 am

Hello,

Thank you for the information.

This function doesn't work at the moment, it doesn't create anything.
Our programmers know about this issue, they will try to fix it in one of the next program builds.

dazamate
Posts: 2
Joined: Tue May 30, 2017 3:44 am

Re: [c++] Object Create obj_Text not working

#3 Postby dazamate » Thu Jun 01, 2017 4:58 pm

FX Helper wrote:Hello,

Thank you for the information.

This function doesn't work at the moment, it doesn't create anything.
Our programmers know about this issue, they will try to fix it in one of the next program builds.


Well I wasted a lot of time trying to debug this.

If there is an issue with it, could you put a note in your documentation so others don't waste hours like I did - this was very frustrating.

I mean you even have code examples in the help file, so I was only to assume it was meant to be in working order.

Thanks.


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 28 guests