Description
Here’s the indicator needed for the LOL robot : https://ctrader.com/algos/cbots/show/4494/
Telegram group : https://t.me/cTraderStrategyTesterProject
GitHub : https://github.com/YesOrNotCtrader/Ctrader-Stragegy-Tester-Project
Enjoy for Free =)
Previous account here : https://ctrader.com/users/profile/70920
Contact telegram : https://t.me/nimi012
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
{
[Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
public class Breakout : Indicator
{
[Parameter(DefaultValue = 1)]
public int PeriodFractale { get; set; }
[Output("Up", LineColor = "Lime", PlotType = PlotType.Points, Thickness = 5)]
public IndicatorDataSeries Up { get; set; }
[Output("Down", LineColor = "Red", PlotType = PlotType.Points, Thickness = 5)]
public IndicatorDataSeries Down { get; set; }
private Fractals fra5, fra200;
protected override void Initialize()
{
fra5 = Indicators.Fractals(PeriodFractale);
fra200 = Indicators.Fractals(PeriodFractale);
}
public override void Calculate(int index)
{
if (fra5.UpFractal.Last(0) >= fra200.UpFractal.Last(0))
Up[index] = fra5.UpFractal.Last(0);
if (fra5.DownFractal.Last(0) >= fra200.DownFractal.Last(0))
Down[index] = fra5.DownFractal.Last(0);
Up[index] = double.IsNaN(Up[index]) ? Up[index - 1] : Up[index];
Down[index] = double.IsNaN(Down[index]) ? Down[index - 1] : Down[index];
}
}
}
YE
YesOrNot2
Joined on 17.05.2024
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: Breakout.algo
- Rating: 5
- Installs: 635
- Modified: 03/09/2024 14:30
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.
Comments
Log in to add a comment.
No comments found.