简体   繁体   中英

How to increase the height of the Arrow in mql4 indicator

我在MQL4指示器中绘制了一些箭头,所以我能够增加箭头的宽度,但是我只想增加箭头的高度,所以请帮助我。

The arrow symbols do not have separate adjust-ability in width and height, its just 'size'. An option would be to plot the arrow head, then draw a trend line object vertically above it to the length that you want.

MQL4 solution

Indicator can instruct an Arrow instance to have "bigger" size using OBJPROP_WIDTH instance attribute:

{ string                        anInterimObjNAME = "S" + sSellCntr;
  ObjectCreate(                 anInterimObjNAME, OBJ_ARROW, 0,      Time[0], Bid );
  ObjectSet(                    anInterimObjNAME, OBJPROP_COLOR,     Red );
  if ( Action == 0 ) ObjectSet( anInterimObjNAME, OBJPROP_ARROWCODE, 1 );
  if ( Action <  0 ) ObjectSet( anInterimObjNAME, OBJPROP_ARROWCODE, 5 );
  ObjectSet(                    anInterimObjNAME, OBJPROP_WIDTH,     1 ); //<--
//ObjectSet(                    anInterimObjNAME, OBJPROP_WIDTH,     32 );//<--
}

New-MQL4 extension

Since Build 509+ there started to be new and new modifications of the MQL4 language syntax. So far, many times opening an integrated help system launches just another language update, so be carefull on coding limits, suddenly changed or unsupported syntax elements and even check several new syntax constructs. This is the life as it goes.

So, for the OBJ_ARROW , there is a possibility to extend it's size beyond a value of 5, which is ( as of Build 670 ) a limit for a manual GUI entry.

Help says:

        Large arrows (more than 5) can only be created
        by setting the appropriate OBJPROP_WIDTH property value
        when writing a code in MetaEditor.

So, manually you still cannot enter more than 5, but via MQL4 code, you can go BIGGER :o)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM