Download MetaTrader 5

Objects refusing to acknowledge parameters?

To add comments, please log in or register
Mark Reno
Mark Reno  
I am having a really odd issue with triangles.  I have coded an indicator that finds harmonic patterns.  For whatever reason, the first triangle of each pattern (xab triangle, and bcd triangle) always renders solid, and blue.  NOTHING I do has any effect on the xab triangle.  The bcd responds exactly as it should, cycling through colors, and switching to the solid fill or wireframe on command.

Does anyone have any idea why the xab triangles refuse to render as anything other than solid and blue?

Here is the code I am using to render the triangles:
string xabName = StringConcatenate(type, "mXAB_S#", hlxTime, hlaTime, hlbTime);
ObjectCreate(cid, xabName, OBJ_TRIANGLE, 0, hlxTime, hlxPrice, hlaTime, hlaPrice, hlbTime, hlbPrice);
ObjectSetInteger(cid, xabName, OBJPROP_COLOR, patternColor);
ObjectSetInteger(cid, xabName, OBJPROP_STYLE, drawStyle);
ObjectSetInteger(cid, xabName, OBJPROP_BACK, DrawSolid);
ObjectSetInteger(cid, xabName, OBJPROP_WIDTH, DrawTriLineXAB);

if (RealTimePointD)
   string bcdName = StringConcatenate(type, "mBCD_S#", hlbTime, hlcTime, hldPrice);
   ObjectCreate(cid, bcdName, OBJ_TRIANGLE, 0, hlbTime, hlbPrice, hlcTime, hlcPrice, hldTime, hldPrice);
   ObjectSetInteger(cid, bcdName, OBJPROP_COLOR, patternColor);
   ObjectSetInteger(cid, bcdName, OBJPROP_STYLE, drawStyle);
   ObjectSetInteger(cid, bcdName, OBJPROP_BACK, DrawSolid);
   ObjectSetInteger(cid, bcdName, OBJPROP_WIDTH, DrawTriLineBCD);
   if (DrawDPrice)
      string tagName = StringConcatenate(type, "dTag_S#", hlbTime, hlcTime, hldPrice);
      ObjectCreate(cid, tagName, OBJ_ARROW_RIGHT_PRICE, 0, hldTime, hldPrice);
      ObjectSetInteger(cid, tagName, OBJPROP_COLOR, patternColor);

Here is the display:
Bad Triangles
Mark Reno
Mark Reno  
Ah ha!  It turns out that the new data format caused the object names to be too long.  Problem solved.

Thanks for coming back to let us know the solution.

I'm sure it will help someone else in the future.

To add comments, please log in or register