Skip to content

Instantly share code, notes, and snippets.

View sin32775's full-sized avatar

shin3 sin32775

  • 2-1-1 南本町、大阪市中央区、大阪、日本本町サザンビル1F
View GitHub Profile
//+------------------------------------------------------------------+
//| RSI1st.mq5 |
//| Copyright 2020, Beleif Co., Ltd. |
//| https://belief-hf.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, Beleif Co., Ltd."
#property link "https://belief-hf.com/"
#property version "1.00"
#property indicator_separate_window
void OnDeinit(const int reason)
{
IndicatorRelease(hRSI);
IndicatorRelease(hRSIMA);
}
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
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)+")");
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_plots 2
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrDodgerBlue
#property indicator_width1 2
#property indicator_style1 STYLE_SOLID
//+------------------------------------------------------------------+
//| MA1st.mq5 |
//| Copyright 2020, Beleif Co., Ltd. |
//| https://belief-hf.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, Beleif Co., Ltd."
#property link "https://belief-hf.com/"
#property version "1.00"
#property indicator_chart_window
void OnDeinit(const int reason)
{
IndicatorRelease(hMA);
}
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
int OnInit()
{
if(InpMaPeriod<1)
{
Print("Error Invalid InpMaPeriod value");
return(INIT_FAILED);
}
//--- indicator buffers mapping
#property copyright "Copyright 2020, Beleif Co., Ltd."
#property link "https://belief-hf.com/"
#property version "1.00"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots 1
#property indicator_type1 DRAW_LINE
#property indicator_color1 clrDeepPink
#property indicator_width1 2