Not logged in
Viewing 5 posts - 1 through 5 (of 5 total)
  • #234421 |
    Conmariin
    Customer
    116 Posts

    Hi,

    I’m using candlestick patterns in the ea and I want to create a Label on the chart above the candle where the pattern was detetcted. For example SHOOTING STAR in Gold. I found out you can do this with ObjectCreate and ObjectSet.

    I’m trying it with Custom Action.

    ObjectCreate(“signal1”,OBJ_LABEL,0,0,0,0,0);
    ObjectSetText(“signal1″,”SHOOTING STAR”,8,”Tahoma”,Gold);

    But this is placing it somwhere on the chart and not above the candle where the pattern is detected.

    Can anyone help?

    Thanks! :)

    Automatisches Handeln mit Expert Advisor
    https://www.rabenesche.de

    #234422
    tomas262
    Administrator
    1827 Posts

    Hello,

    try this instead: ObjectCreate(“signal1”,OBJ_LABEL,0,Time[1]);

    Let me know if it helped

    #234425
    Conmariin
    Customer
    116 Posts

    Hi Tomas! :)

    when i Take your solution it drops out in meta-editor this error:

    ‘ObjectCreate’ – no one of the overloads can be applied to the function call CandlestickPattern.mq4
    could be one of 2 function(s) LightsOnThree3.mq4
    built-in ‘ObjectCreate’ CandlestickPattern.mq4
    built-in ‘ObjectCreate’ CandlestickPattern.mq4
    1 error(s), 0 warning(s) 2 1

    When I take ObjectCreate(“signal1”,OBJ_LABEL,0,0.Time[1]);
    instead of your solution
    ObjectCreate(“signal1”,OBJ_LABEL,0,Time[1]);
    then there wer no errors, but it paints the label sonewhere in the chart like in the screenshot.

     

    Edit: Your solution throws no error with ObjectCreate(“signal1”,OBJ_LABEL,0,Time[1],0,0,0); but its still in the corner of the chart and not above the candle.

    Attachments:
    You must be logged in to view attached files.

    Automatisches Handeln mit Expert Advisor
    https://www.rabenesche.de

    #234428
    Conmariin
    Customer
    116 Posts

    I found a solution that will do it for me:

    // Action #2
    // Custom action
    ObjectCreate(“signal1”,OBJ_TEXT,0,Time[1],High[1]);

    // Action #3
    // Custom action
    ObjectSetText(“signal1″,”HAMMER”,8,”Tahoma”,Gold);

    // Action #4
    // Custom action
    ObjectSetDouble(ChartID(), “signal1”, OBJPROP_ANGLE, 0);

    // Action #5
    // Custom action
    ObjectSetInteger(ChartID(), “signal1”, OBJPROP_ANCHOR, ANCHOR_TOP);

    it looks then like in the screenshot. :)

    Attachments:
    You must be logged in to view attached files.

    Automatisches Handeln mit Expert Advisor
    https://www.rabenesche.de

    #234439
    tomas262
    Administrator
    1827 Posts

    OK, glad you figured it out. Let me know when you need any help

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.