Created
December 21, 2020 07:41
-
-
Save sin32775/a7494db7e22383bea2f582c9d15891d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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