I am building strategy which include painting rectangle object (supply and demand). Everything is working fine except rectangle fill color(OBJPROP_FILLINSIDE and OBJPROP_FILLCOLOR). Let me copy some code to view:
Code: Select all
//if rectangle is bellow current price then use color blue
if (Bid > ( ObjectGet('Rectangle '+FloatToStr(i),OBJPROP_PRICE1))) And (Bid > ( ObjectGet('Rectangle '+FloatToStr(i),OBJPROP_PRICE2))) then
begin
ObjectSet('Rectangle '+FloatToStr(i), OBJPROP_COLOR , DeColor);
ObjectSet('Rectangle '+FloatToStr(i), OBJPROP_FILLINSIDE , 1);
ObjectSet('Rectangle '+FloatToStr(i), OBJPROP_FILLCOLOR , DeColor);
end;
Code works on border color set (OBJPROP_COLOR), but does not work on other two lines OBJPROP_FILLINSIDE and OBJPROP_FILLCOLOR. I know that code is OK, if I put this lines on indicator every thing works.
Becaus I am new in programing, I have another question.
It is posible to code strategy/indicator to know in wich time frame is rectangle been drawn and remove it form other timeframes? Rectangle is drawn by hand. And I know that can be done in properties, but is time consuming.
Thank you for your help.
Mitja