Description
This is based on the Strategy as seen on Andy's channel
Also if anyone knows a better way to adjust the time frames to better calculate it that would be awesome as well.
There is an adjustable Factor for the MACD to make it fit with the RSI, so far this is done manualy but I'm sure there is a better way to code this to make it easier to use.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo
{
[Cloud ( "RSI", "RSI50", Opacity = 0.6 , FirstColor = "RSI", SecondColor = "RSI50")]
[Cloud ( "Macd", "Signal", Opacity = 0.8 , FirstColor = "Macd", SecondColor = "Signal")]
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class RSIMACD : Indicator
{ // EMA FFAA4400 SMA FF88AA44 50 AA7733AA P 88554488//
public DataSeries Source { get; set; }
[Parameter("Long Cycle", DefaultValue = 26)]
public int LongCycle { get; set; }
[Parameter("Short Cycle", DefaultValue = 12)]
public int ShortCycle { get; set; }
[Parameter("Signal Periods", DefaultValue = 9)]
public int Periods { get; set; }
[Parameter("MACD Adjuster Adjust this for different charts and time frames \n eg EUR 5m set to 40000, and XAU 5m set to 10 \n hint add 0's to find MACD \n Also untik all the boxs for better viewing ", DefaultValue = 4)]
public int Factor { get; set; }
[Output("Macd", LineColor = "AA00AA00",Thickness =1, PlotType = PlotType.DiscontinuousLine)]
public IndicatorDataSeries Macd {get;set;}
[Output("Signal", LineColor = "AAAA0000",Thickness =1, PlotType = PlotType.DiscontinuousLine)]
public IndicatorDataSeries Signal {get;set;}
[Parameter("RP", DefaultValue = 14)]
public int RPeriod { get; set; }
[Output("RSI70", LineColor = "FF33C1F3")]
public IndicatorDataSeries RSI70 { get; set; }
[Output("RSI50", LineColor = "AA554488")]
public IndicatorDataSeries RSI50 { get; set; }
[Output("RSI30", LineColor = "FF33C1F3")]
public IndicatorDataSeries RSI30 { get; set; }
[Output("RSI", LineColor = "AAFFFF00")]
public IndicatorDataSeries RSI { get; set; }
private RelativeStrengthIndex rsi;
private MacdCrossOver macdCrossOver;
protected override void Initialize()
{
rsi = Indicators.RelativeStrengthIndex(Source, RPeriod);
macdCrossOver = Indicators.MacdCrossOver(LongCycle, ShortCycle, Periods);
}
public override void Calculate(int index)
{
RSI[index] = rsi.Result[index];
RSI70[index] = (rsi.Result[index] + 70)-rsi.Result[index];
RSI50[index] = (rsi.Result[index] + 50)-rsi.Result[index];
RSI30[index] = (rsi.Result[index] + 30)-rsi.Result[index];
Macd[index] = macdCrossOver.MACD[index]*Factor+50;
Signal[index] = macdCrossOver.Signal[index]*Factor+50;
{
}
}
}
}
VE
VEI5S6C4OUNT0
Joined on 06.12.2022
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: RSI MACD CLOUD.algo
- Rating: 0
- Installs: 862
- Modified: 15/02/2023 08:18
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Re: drift boss
Good information!