Jump to content

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

Recommended Posts

Posted

cUSTOM rECTANgLE

 

 

 

#property copyright "Kalenzo"

#property link "http://www.fxservice.eu"

 

#property indicator_chart_window

 

extern int candleShift = 11;

extern string rectangleName = "REC1";

extern int iPrice = 3;

extern bool useColors = TRUE;

extern color defaultColor = DodgerBlue;

extern color upColor = Green;

extern color dnColor = Red;

 

int init() {

return (0);

}

 

int deinit() {

return (0);

}

 

int start() {

ObjectDelete(rectangleName);

ObjectCreate(rectangleName, OBJ_RECTANGLE, 0, Time[candleShift], getPrice(iPrice, candleShift), Time[0], getPrice(iPrice, 0));

ObjectSet(rectangleName, OBJPROP_WIDTH, 2);

if (useColors) {

if (Close[candleShift] > Close[0]) ObjectSet(rectangleName, OBJPROP_COLOR, dnColor);

else ObjectSet(rectangleName, OBJPROP_COLOR, upColor);

} else ObjectSet(rectangleName, OBJPROP_COLOR, defaultColor);

return (0);

}

 

double getPrice(int ai_0, int ai_4) {

switch (ai_0) {

case 0:

return (Open[ai_4]);

case 1:

return (High[ai_4]);

case 2:

return (Low[ai_4]);

case 3:

return (Close[ai_4]);

}

return (Close[ai_4]);

}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

⤴️-Paid Ad- Check advertising disclaimer here. Add your banner here.🔥

×
×
  • Create New...