Description
const
cCPF = 0;
cSenha = 0;
cCodigo = 1234567890;
cDia1 = 22;
cMes1 = 12;
cAno1 = 2023;
cDia2 = 22;
cMes2 = 12;
cAno2 = 2023;
input
CPF (0);
Senha (0);
begin
if ((ELDate(cAno1, cMes1, cDia1) = ELDate(cAno2, cMes2, cDia2)) and
(CurrentDate <= (ELDate(cAno1, cMes1, cDia1))) and
(((CPF = cCPF) and (Senha = cSenha)) or (CPF = cCodigo))) then
begin
begin
plot (mediaexp(9,Ifr(6)));
end;
begin
if (mediaexp(5,IFR(6)))>(mediaexp(12,IFR(9)))
then
setplotcolor(1,clyellow );
setplotwidth(1,2);
end;
begin
if(mediaexp(5,IFR(5)))<(mediaexp(12,IFR (9)))
then
setplotcolor(1,clyellow);
begin
plot3(mediaexp(50,Ifr(25)[1]*1.423));
setplotcolor(3,clskyblue);
setplotwidth(3,2);
end;
begin
Plot4(mediaexp(50,IFR (25)[1]/1.423));
setplotcolor(4,clskyblue);
setplotwidth(4,2);
end;
end;
end
else
begin
PaintBar(clBranco);
end;
end
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
[Levels(-100, -50, 0, 50, 100)]
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class mPFE : Indicator
{
[Parameter("PeriodFastROC (7)", DefaultValue = 1, MinValue = 1)]
public int PeriodFastROC { get; set; }
[Parameter("PeriodSlowROC (9)", DefaultValue = 9, MinValue = 3)]
public int PeriodSlowROC { get; set; }
[Parameter("PeriodMA (5)", DefaultValue = 5, MinValue = 1)]
public int PeriodMA { get; set; }
[Parameter("PDS (710)", DefaultValue = 10, MinValue = 1)]
public int PDS { get; set; }
[Parameter("MA Type", DefaultValue = MovingAverageType.Exponential)]
public MovingAverageType MAType { get; set; }
[Output("olarized Fractal Efficiency", LineColor = "Black", PlotType = PlotType.Line, Thickness = 1)]
public IndicatorDataSeries outPFE { get; set; }
private IndicatorDataSeries _raw;
private IndicatorDataSeries _pfe;
private MovingAverage _pfema;
double slow, fast, x, y, z;
protected override void Initialize()
{
_raw = CreateDataSeries();
_pfe = CreateDataSeries();
_pfema = Indicators.MovingAverage(_raw, PeriodMA, MAType);
}
public override void Calculate(int i)
{
slow = (Bars.ClosePrices[i + PeriodSlowROC] != 0 ? 100.0 * (Bars.ClosePrices[i] / Bars.ClosePrices[i + PeriodSlowROC] - 1) : 0);
fast = (Bars.ClosePrices[i + PeriodFastROC] != 0 ? 100.0 * (Bars.ClosePrices[i] / Bars.ClosePrices[i + PeriodFastROC] - 1) : 0);
x = Math.Sqrt(slow * slow + 100.0);
y = Math.Sqrt(fast * fast + 1.0) + PDS;
z = x / (y != 0 ? y : 1);
_raw[i] = (Bars.ClosePrices[i] > Bars.ClosePrices[i + PeriodSlowROC] ? 100.0 * z : -100.0 * z);
outPFE[i] = _pfema.Result[i];
}
}
}
mariocontaforex
Joined on 01.02.2023
- Distribution: Paid
- Language: C#
- Trading platform: cTrader Automate
- File name: mPFE (1).algo
- Rating: 0
- Installs: 221
- Modified: 01/02/2023 15:44
Re: basket random
I have completely followed this suggestion.