Cbot Para Renko

Created at 26 Jul 2021, 21:46
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
ED

edumchado

Joined 26.07.2021

Cbot Para Renko
26 Jul 2021, 21:46


hello, I'm looking to develop a simple Cbot that trades on a renko chart, just buying on a positive brick and selling on a negative brick, I've been getting good results trading that way (I use more filters for input of course) but a Cbot to help me with this would be great, if anyone can leave an opinion I appreciate it.


@edumchado
Replies

m4trader4
10 Nov 2021, 11:47

Attached is code snippet from my code. There are lot of other parameters.

 

 
 
  protected override void OnStart()
        {
           Bars.BarOpened += Bars_BarOpened;
        }
 
 
 
 
 
 private void Bars_BarOpened(BarOpenedEventArgs obj)
        {
		
			 var bars = obj.Bars;
			 
			  double AOC1O = bars.OpenPrices.Last(1);
              double AOC1H = bars.HighPrices.Last(1);
              double AOC1L = bars.LowPrices.Last(1);
              double AOC1C = bars.ClosePrices.Last(1);
			  
					double AOC1O = bars.OpenPrices.Last(1);
                    double AOC1H = bars.HighPrices.Last(1);
                    double AOC1L = bars.LowPrices.Last(1);
                    double AOC1C = bars.ClosePrices.Last(1);

                    double AOC2O = Bars.OpenPrices[Bars.Count - 3];
                    double AOC2H = Bars.HighPrices[Bars.Count - 3];
                    double AOC2L = Bars.LowPrices[Bars.Count - 3];
                    double AOC2C = Bars.ClosePrices[Bars.Count - 3];


                    double AOC3O = Bars.OpenPrices[Bars.Count - 4];
                    double AOC3H = Bars.HighPrices[Bars.Count - 4];
                    double AOC3L = Bars.LowPrices[Bars.Count - 4];
                    double AOC3C = Bars.ClosePrices[Bars.Count - 4];
			  
			  
			
			  
			  if (AOC2L > AOC1L )
                    {
						//Place Sell Orders
					}
		
			if (AOC1H > AOC2H)
                    {
					
					//Place Buy Order
					}
		
		
		}


 


@m4trader4