Category Other  Published on 25/01/2015

Product

Description

A primitive indicator showing the result of arithmetic multiplication of two source series. This is particularly useful as a building block for combining with other indicators, for creating chains of dependent indicators and for outsourcing data further. Also check out other basic building blocks: Difference, Ratio and Sum.


using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo {

	[Indicator (IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
	public class Product : Indicator {
	
		[Parameter ()]
		public DataSeries Source1 { get; set; }
		
		[Parameter ()]
		public DataSeries Source2 { get; set; }
		
		[Output	("Result")]
		public IndicatorDataSeries Result { get; set; }

		protected override void Initialize () {
		}

		public override void Calculate (int index) {
			Result[index] = Source1[index] * Source2[index];
		}
	}
}


IG
igorkroitor

Joined on 03.01.2015

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: Product.algo
  • Rating: 0
  • Installs: 2553
  • Modified: 13/10/2021 09:54
Comments
Log in to add a comment.
No comments found.