mapseam
mapseam's avatar

Info

Username:mapseam
Name:mapseam
Member since: 24 May 2016

About

None

Signature

None

Last Algorithm Comments

@Renko:  21 Nov 2018, 10:10


Can I do the calculation of Renko bars inside the bot? using System; using System.Linq; using cAlgo.API; using cAlgo.API.Indicators; using cAlgo.API.Internals; using cAlgo.Indicators; namespace cAlgo.Robots {     [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]     public class My_RenkoRobot : Robot     {         [Parameter("Renko (Pips)", DefaultValue = 10.0, MinValue = 0.1, Step = 1)]         public double RenkoPips { get; set; }     protected class Brick         {             public double Open { get; set; }             public double Close { get; set; }         }         protected List<Brick> Bricks = new List<Brick>();         private double closeLastValue, renkoPips, renkoLastValue;     private MarketSeries M1;         protected override void OnStart()         {         // ...             renkoPips = RenkoPips * Symbol.PipSize;                  M1 = MarketData.GetSeries(TimeFrame.Minute);                 var open = M1.Open.LastValue;             renkoLastValue = open - (open % renkoPips) + renkoPips / 2;         int totalBars = Math.Min(LookupBars + 1, M1.Close.Count);         for (int i = 0; i < totalBars; i++)         {                 closeLastValue = M1.Close[i];                 while (closeLastValue >= renkoLastValue + renkoPips * 1.5)                 {                     renkoLastValue += renkoPips;                     Bricks.Insert(0, new Brick                     {                             Open = renkoLastValue - renkoPips / 2,                 Low = Open,                             Close = renkoLastValue + renkoPips / 2,                 High = Close                     });                 }                 while (closeLastValue <= renkoLastValue - renkoPips * 1.5)                 {                     renkoLastValue -= renkoPips;                     Bricks.Insert(0, new Brick                     {                             Open = renkoLastValue + renkoPips / 2,                 High = Open,                             Close = renkoLastValue - renkoPips / 2,                 Low = Close                     });                 }                 }         // ...     }         protected override void OnTick()         {         // ...             double y1, y2;             var top = Math.Max(Bricks[0].Open, Bricks[0].Close);             var bottom = Math.Min(Bricks[0].Open, Bricks[0].Close);         closeLastValue = M1.Close[0];             if (closeLastValue > top)                 y1 = top;             else if (closeLastValue < bottom)                 y1 = bottom;             else                 y1 = closeLastValue;             y2 = closeLastValue;             Bricks[0].Open = y1;             Bricks[0].High = y1 > y2 ? y1 : y2;             Bricks[0].Low = y1 < y2 ? y1 : y2;             Bricks[0].Close = y2;         // ...     }     } }

@Renko:  08 Nov 2018, 10:11


Thanx for you renko indi! renko = Indicators.GetIndicator<Renko>(RenkoPips, BricksToShow, 3, "SeaGreen", "Tomato"); Buy renko.Bricks.Count() = 0. Tell me please, why?

Last Forum Posts

@Synthetic instruments (with +, -, *, / operators) a-la TradingView.com (example: AAPL / XAUUSD):  09 Jun 2018, 06:45


We are use the one of four operators; (-) for subtraction, (+) for addition, (*) for multiplication or (/) for division.

For Example: Entering AAPL / XAUUSD will create a comparison of Apple vs. Gold by dividing Apple prices by Gold prices.

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.

No uploaded.

Warning! Executing cBots downloaded from this section may result in loss of funds. Use them at your own risk.

No uploaded.