Files
mql5-skills/skills/mql5/references/docs/34-standardlibrary/2276-standardlibrary-chart-object-classes-obj-arrows-cchartobjectarrow-cchartobjectarrowcreate.md
T
2026-06-23 21:47:51 +08:00

70 lines
1.3 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Create
Creates "Arrow" graphical object.
```
bool  Create(
   long      chart_id,     // chart ID
   string    name,         // object Name
   int       window,       // chart Window
   datetime  time,         // time
   double    price,        // price
   char      code          // arrow code
   )
```
Parameters
chart_id
[in]  Chart identifier (0 current chart).
name
[in]  A unique object name.
window
[in]  Chart window number (0 main window).
time
[in]  Time coordinate.
price
[in]  Price coordinate.
code
[in]  "Arrow" code (Wingdings).
Return Value
true success, false - error.
Example:
```
//--- example for CChartObjectArrow::Create   
#include <ChartObjects\ChartObjectsArrows.mqh>   
//---   
void OnStart()   
  {   
   CChartObjectArrow arrow;   
//--- set object parameters   
   double price=SymbolInfoDouble(Symbol(),SYMBOL_BID);   
   if(!arrow.Create(0,"Arrow",0,TimeCurrent(),price,181))   
     {   
      //--- arrow create error   
      printf("Arrow create: Error %d!",GetLastError());   
      //---   
      return;   
     }      
//--- use arrow   
//--- . . .   
  }   
```