MathArcsinh

쌍곡선 아크사인을 반환.

double  MathArcsinh(
   double  value      // -∞ < 값 < +
   );

매개변수

val

[in]   계산되어야 하는 쌍곡선 아크사인 값

값 반환

수의 쌍곡선 아크사인.

주의

MathArcsinh() 함수 대신 asinh() 함수를 사용할 수 있습니다.

 

예:

#define GRAPH_WIDTH  750
#define GRAPH_HEIGHT 350
 
#include <Graphics\Graphic.mqh>
 
CGraphic ExtGraph;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   vector delta=vector::Full(101,2*M_PI/10);
   delta[0]=-31;
//--- 델타 단계를 사용하여 -31에서 2pi까지 101개의 값을 얻습니다.
   vector X=delta.CumSum();
//--- X 벡터의 각 값에 대한 쌍곡선 아크 사인 값을 계산합니다.
   vector Y=MathArcsinh(X);
 
//--- 계산된 값을 벡터에서 배열로 전송합니다.
   double x_array[],y_array[];
   X.Swap(x_array);
   Y.Swap(y_array);
 
//--- 계산된 벡터 값의 그래프를 그립니다.
   CurvePlot(x_array,y_array,clrDodgerBlue);
 
//--- Escape 또는 PgDn 키를 눌러 그래프를 삭제하고(스크린샷 하기) 종료할 때까지 기다립니다.
   while(!IsStopped())
     {
      if(StopKeyPressed())
         break;
      Sleep(16);
     }
 
//--- 모두 삭제
   ExtGraph.Destroy();
  }
//+------------------------------------------------------------------+
//| ESC를 누르면 'true'를 반환합니다                                    |
//| PgDn을 누르면 그래프 스크린샷을 찍고 'true'를 반환합니다               |
//| 그렇지 않으면 'false'를 반환 합니다                                 |
//+------------------------------------------------------------------+
bool StopKeyPressed()
  {
//--- ESC를 누르면 'true'를 반환합니다.
   if(TerminalInfoInteger(TERMINAL_KEYSTATE_ESCAPE)!=0)
      return(true);
//--- PgDn을 누르고 그래프 스크린샷이 성공적으로 촬영되면 'true'를 반환합니다
   if(TerminalInfoInteger(TERMINAL_KEYSTATE_PAGEDOWN)!=0 && MakeAndSaveScreenshot(MQLInfoString(MQL_PROGRAM_NAME)+"_Screenshot"))
      return(true);
//--- 'false'를 반환합니다 
   return(false);
  }
//+------------------------------------------------------------------+
//| 그래프 객체를 만들고 곡선 그리기                                     |
//+------------------------------------------------------------------+
void CurvePlot(double &x_array[], double &y_array[], const color colour)
  {
   ExtGraph.Create(ChartID(), "Graphic"000GRAPH_WIDTHGRAPH_HEIGHT);
   ExtGraph.CurveAdd(x_arrayy_arrayColorToARGB(colour), CURVE_LINES);
   ExtGraph.IndentUp(30);
   ExtGraph.CurvePlotAll();
stringtext1="그래프를 삭제하고 스크립트를 중지하려면 ESC를 누르십시오. 또는";
stringtext2=" 화면을 만들고 그래프를 삭제하고 스크립트를 중지하려면 PgDn을 누르세요";
   ExtGraph.TextAdd(549text1ColorToARGB(clrBlack));
   ExtGraph.TextAdd(54,21text2ColorToARGB(clrBlack));
   ExtGraph.Update();
  }
//+------------------------------------------------------------------+
//| 스크린샷을 찍어 이미지를 파일로 저장                                  |
//+------------------------------------------------------------------+
bool MakeAndSaveScreenshot(const string file_name)
  {
   string file_names[];
   ResetLastError();
   int selected=FileSelectDialog("Save Picture"NULL"All files (*.*)|*.*"FSD_WRITE_FILEfile_namesfile_name+".png");
   if(selected<1)
     {
      if(selected<0)
         PrintFormat("%s: FileSelectDialog() function returned error %d"__FUNCTION__GetLastError());
      return false;
     }
   
   bool res=false;
   if(ChartSetInteger(0,CHART_SHOW,false))
      res=ChartScreenShot(0file_names[0], GRAPH_WIDTHGRAPH_HEIGHT);
   ChartSetInteger(0,CHART_SHOW,true);
   return(res);
  }

 

결과:

MathArcsinh_Screenshot

추가 참조

실제 유형 (double, float)