//+------------------------------------------------------------------+ //| Create the arrow | //+------------------------------------------------------------------+ bool ArrowCreate(const long chart_ID=0, // chart's ID const string name="Arrow", // arrow name const int sub_window=0, // subwindow index datetime time=0, // anchor point time double price=0, // anchor point price const uchar arrow_code=252, // arrow code const ENUM_ARROW_ANCHOR anchor=ANCHOR_BOTTOM, // anchor point position const color clr=clrRed, // arrow color const ENUM_LINE_STYLE style=STYLE_SOLID, // border line style const int width=3, // arrow size const bool back=false, // in the background const bool selection=false, // highlight to move const bool hidden=true, // hidden in the object list const long z_order=0) // priority for mouse click { //--- set anchor point coordinates if they are not set ChangeArrowEmptyPoint(time,price); //--- reset the error value ResetLastError(); //--- create an arrow if(!ObjectCreate(chart_ID,name,OBJ_ARROW,sub_window,time,price)) { Print(__FUNCTION__, ": failed to create an arrow! Error code = ",GetLastError()); return(false); } //--- set the arrow code ObjectSetInteger(chart_ID,name,OBJPROP_ARROWCODE,arrow_code); //--- set anchor type ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,anchor); //--- set the arrow color ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr); //--- set the border line style ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style); //--- set the arrow's size ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,width); //--- display in the foreground (false) or background (true) ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back); //--- enable (true) or disable (false) the mode of moving the arrow by mouse //--- when creating a graphical object using ObjectCreate function, the object cannot be //--- highlighted and moved by default. Inside this method, selection parameter //--- is true by default making it possible to highlight and move the object ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection); ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection); //--- hide (true) or display (false) graphical object name in the object list ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden); //--- set the priority for receiving the event of a mouse click in the chart ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order); //--- successful execution return(true); } //+------------------------------------------------------------------+ //| Move the anchor point | //+------------------------------------------------------------------+ bool ArrowMove(const long chart_ID=0, // chart's ID const string name="Arrow", // object name datetime time=0, // anchor point time coordinate double price=0) // anchor point price coordinate { //--- if point position is not set, move it to the current bar having Bid price if(!time) time=TimeCurrent(); if(!price) price=SymbolInfoDouble(Symbol(),SYMBOL_BID); //--- reset the error value ResetLastError(); //--- move the anchor point if(!ObjectMove(chart_ID,name,0,time,price)) { Print(__FUNCTION__, ": failed to move the anchor point! Error code = ",GetLastError()); return(false); } //--- successful execution return(true); } //+------------------------------------------------------------------+ //| Change the arrow code | //+------------------------------------------------------------------+ bool ArrowCodeChange(const long chart_ID=0, // chart's ID const string name="Arrow", // object name const uchar code=252) // arrow code { //--- reset the error value ResetLastError(); //--- change the arrow code if(!ObjectSetInteger(chart_ID,name,OBJPROP_ARROWCODE,code)) { Print(__FUNCTION__, ": failed to change the arrow code! Error code = ",GetLastError()); return(false); } //--- successful execution return(true); } //+------------------------------------------------------------------+ //| Change anchor type | //+------------------------------------------------------------------+ bool ArrowAnchorChange(const long chart_ID=0, // chart's ID const string name="Arrow", // object name const ENUM_ARROW_ANCHOR anchor=ANCHOR_TOP) // anchor type { //--- reset the error value ResetLastError(); //--- change anchor type if(!ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,anchor)) { Print(__FUNCTION__, ": failed to change anchor type! Error code = ",GetLastError()); return(false); } //--- successful execution return(true); } //+------------------------------------------------------------------+ //| Delete an arrow | //+------------------------------------------------------------------+ bool ArrowDelete(const long chart_ID=0, // chart's ID const string name="Arrow") // arrow name { //--- reset the error value ResetLastError(); //--- delete an arrow if(!ObjectDelete(chart_ID,name)) { Print(__FUNCTION__, ": failed to delete an arrow! Error code = ",GetLastError()); return(false); } //--- successful execution return(true); } //+------------------------------------------------------------------+ //| Check anchor point values and set default values | //| for empty ones | //+------------------------------------------------------------------+ void ChangeArrowEmptyPoint(datetime &time,double &price) { //--- if the point's time is not set, it will be on the current bar if(!time) time=TimeCurrent(); //--- if the point's price is not set, it will have Bid value if(!price) price=SymbolInfoDouble(Symbol(),SYMBOL_BID); } //+------------------------------------------------------------------+
You could see this for example.
Then you can see it has:
//--- set the arrow code ObjectSetInteger(chart_ID,name,OBJPROP_ARROWCODE,arrow_code);
Maybe give that a go.(Just the arrowcode number so not CharToString());
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
This line of code relates to a wingding that is responsive to RSI. Here are the relevant lines of code:
When I compile the overall code, it creates problems in the display. Here is the display when the indicator is working:
If I compile the code though, the wingdings code gets messed up and it displays as follows.
Any help appreciated - I want to change some parameters in the code, but I can't due to the issue that happens when I recompile:
I've tried using, for example, CharStringtoText(233) which is presented as a solution in other threads, but that does not pick up the right wingding...