danielpintoadv
danielpintoadv's avatar

Info

Username:danielpintoadv
Name:danielpintoadv
Member since: 17 Jul 2022

About

None

Signature

None
Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
top trade
  10
  0
  456
free  17 Jul 2022
<font style="vertical-align: inherit;"><font style="vertical-align: inherit;">´╗┐usando Sistema;</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> usando cAlgo.API;</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> usando cAlgo.API.Internals;</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> usando cAlgo.API.Indicators;</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> usando cAlgo.Indicators;</font></font><font></font> <font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> namespace cAlgo</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> {</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">     [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">     classe pública UTBOT : Indicador</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">     {</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         [Parameter("Chave", DefaultValue = 1)]</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         valor-chave public double { get; </font><font style="vertical-align: inherit;">definir; </font><font style="vertical-align: inherit;">}</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         [Parameter("Período ATR", DefaultValue = 10)]</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         public int atrperiod { get; </font><font style="vertical-align: inherit;">definir; </font><font style="vertical-align: inherit;">}</font></font><font></font> <font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         privado AverageTrueRange xATR;</font></font><font></font> <font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         [Output("UpTrend", PlotType = PlotType.DiscontinuousLine, LineColor = "Green")]</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         public IndicatorDataSeries XATRTrailingStopGreen { get; </font><font style="vertical-align: inherit;">definir; </font><font style="vertical-align: inherit;">}</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         [Output("Contínuos", PlotType = PlotType.DiscontinuousLine, LineColor = "Verde")]</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         public IndicatorDataSeries XATRTrailingStop { get; </font><font style="vertical-align: inherit;">definir; </font><font style="vertical-align: inherit;">}</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         [Output("DownTrend", PlotType = PlotType.DiscontinuousLine, LineColor = "Red")]</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         public IndicatorDataSeries XATRTrailingStopRed { get; </font><font style="vertical-align: inherit;">definir; </font><font style="vertical-align: inherit;">}</font></font><font></font> <font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         substituição protegida void Initialize()</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         {</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">             xATR = Indicators.AverageTrueRange(atrperiod, MovingAverageType.Exponential);</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         }</font></font><font></font> <font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         substituição pública void Calcular(int index)</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         {</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">             double nLoss = valor-chave * xATR.Result[index];</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">             XATRTrailingStop[index] = (MarketSeries.Close[index] > XATRTrailingStop[index - 1] && MarketSeries.Close[index - 1] > XARTrailingStop[index - 1]) ? </font><font style="vertical-align: inherit;">Math.Max(XATRTrailingStop[index - 1], MarketSeries.Close[index] - nLoss) : (MarketSeries.Close[index] < XATRTrailingStop[index - 1] && MarketSeries.Close[index - 1] < XATRTrailingStop[index - 1 ]) ? </font><font style="vertical-align: inherit;">Math.Min(XATRTrailingStop[index - 1], MarketSeries.Close[index] + nLoss) : (MarketSeries.Close[index] > XARTrailingStop[index - 1]) ? </font><font style="vertical-align: inherit;">MarketSeries.Close[index] - nLoss : MarketSeries.Close[index] + nLoss;</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">             XATRTrailingStopGreen[índice] = XATRTrailingStop[índice] < MarketSeries.Close[índice] ? </font><font style="vertical-align: inherit;">XATRTrailingStop[índice] : double.NaN;</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">             XATRTrailingStopRed[índice] = XATRTrailingStop[índice] > MarketSeries.Close[índice] ? </font><font style="vertical-align: inherit;">XATRTrailingStop[índice] : double.NaN;</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">         }</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">     }</font></font><font></font><font style="vertical-align: inherit;"><font style="vertical-align: inherit;"> }</font></font><font></font>
Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.

No uploaded.