Skip to content

Instantly share code, notes, and snippets.

@sin32775
Created December 21, 2020 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sin32775/a7494db7e22383bea2f582c9d15891d1 to your computer and use it in GitHub Desktop.
Save sin32775/a7494db7e22383bea2f582c9d15891d1 to your computer and use it in GitHub Desktop.
int OnInit()
{
if(InpMaPeriod<1)
{
Print("Error Invalid InpMaPeriod value");
return(INIT_FAILED);
}
//--- indicator buffers mapping
SetIndexBuffer(0,MABuffer,INDICATOR_DATA);
IndicatorSetString(INDICATOR_SHORTNAME,"はじめての移動平均");
PlotIndexSetString(0,PLOT_LABEL,"MA1st("+string(InpMaPeriod)+")");
hMA=iMA(NULL,0,InpMaPeriod,0,InpMAMethod,InpMAApply);
if(hMA==INVALID_HANDLE)
{
Print("Error INVALID_HANDLE");
return(INIT_FAILED);
}
//---
return(INIT_SUCCEEDED);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment