Skip to content

Instantly share code, notes, and snippets.

@sin32775
Created December 21, 2020 12:09
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/326754165ae6bb9bc6a9324406e6ccef to your computer and use it in GitHub Desktop.
Save sin32775/326754165ae6bb9bc6a9324406e6ccef to your computer and use it in GitHub Desktop.
int OnInit()
{
//--- indicator buffers mapping
SetIndexBuffer(0,RSI_Buffer,INDICATOR_DATA);
SetIndexBuffer(1,MA_Buffer,INDICATOR_DATA);
IndicatorSetString(INDICATOR_SHORTNAME,"RSI1st("+(string)RSI_Period+","+(string)MA_Period+")");
PlotIndexSetString(0,PLOT_LABEL,"RSI("+string(RSI_Period)+")");
PlotIndexSetString(1,PLOT_LABEL,"RSI 移動平均線("+string(RSI_Period)+","+string(MA_Period)+")");
IndicatorSetInteger(INDICATOR_DIGITS,2);
hRSI=iRSI(NULL,0,RSI_Period,InpMAApply);
hRSIMA=iMA(NULL,0,MA_Period,0,InpMAMethod,hRSI);
//---
return(INIT_SUCCEEDED);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment