Request - Add new object types to API

How to create strategies and indicators
Message
Author
oublette
Posts: 4
Joined: Wed Jan 11, 2017 9:09 am

Request - Add new object types to API

#1 Postby oublette » Sun Jan 15, 2017 8:05 pm

I would like to be able to use the objects such as "Arrows" and "Price Labels" in my projects.

Currently it seems like these are not available in the API. Doing some analysis I've found that the list of object types currently is :

Code: Select all

// object types
enum TObjectType {
  obj_AnyObject        = 0,
  obj_VLine            = 1,
  obj_HLine            = 2,
  obj_TrendLine        = 3,
  obj_Ray              = 4,
  obj_PolyLine         = 5,
  obj_FiboRetracement  = 6,
  obj_FiboTimeZones    = 7,
  obj_FiboArc          = 8,
  obj_FiboFan          = 9,
  obj_AndrewsPitchfork = 10,
  obj_Text             = 11,
  obj_TextLabel        = 12,
  obj_Rectangle         = 13,
  obj_Ellipse         = 14,
  obj_Triangle         = 15,
  obj_FiboChannel      = 16,
  obj_LRChannel        = 17,
  obj_FiboExtension    = 18,
  obj_Sign           = 19,
  obj_RightPriceLabel   = 20,
  obj_LeftPriceLabel     = 21,
  obj_PriceLabel      = 22
};


If I say, would like to use an "ARROW DOWN" sign, I would expect to be able to do the follow:

Code: Select all

ObjectCreate("arrow_down", obj_Sign, 0, Time(1), Close(1));
ObjectSet("arrow_down" OBJPROP_STYLE, OBJ_ARROW_DOWN);


Obviously. OBJ_ARROW_DOWN does not exist at the minute. I've iterated though a large amount of indices attempting to set any values for the SIGN type, ( obj_Sign = 19), and none appear to have any the desired effect of setting the sign type. When I create an object of type (obj_Sign = 19) I always get an UP_ARROW that I pretty much can't do anything with.

Doing some checking I see that this type has different flavors :

Code: Select all

ARROW_UP
ARROW_DOWN
CROSS
THUMB_UP
THUMB_DOWN
TICK_MARK


I would love to be able to get access to these objects in my projects... and If I am just doing something wrong and someone has a suggestion on how to use these objects, I would very much appreciate it.

Also, It would be great if we could get functions similar to the ObjectsTotal() & ObjectName() functions in MQL...

Code: Select all

int obj_total=ObjectsTotal();
string obj_name;
for(int i=0;i<obj_total;i++)
{
     obj_name = ObjectName(i)


This would allow the iteration of all the objects on a chart and would also be very useful to me.

Thanks so much, and I hope these suggestions get taken on board. It looks like the API (the c version) with FT3 is very out of date and I've had to add a lot to it, is there any plan to release a new version?

Thanks again,

Oublette

Return to “FT API”

Who is online

Users browsing this forum: No registered users and 14 guests