Description
// Only For beginners .this is TMA translate into chinese. use Color of violet and period of 16.More like waves //than sma,smma,ema. //
//N= peroid.
using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using cAlgo.Indicators; // 系统自动的语句------------------------------------------------------------------------------------ namespace cAlgo { // 指标一般都是这个语句---------------------------------------------------------- [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] //--isoverlay 是否显示在图表上;utc是服务器时间、ChinaStandardTime北京时间; .none不需要处理权,有(FullAccess、Internet) public class SinMa : Indicator { //--公用类------------TriangularMa 是类名称赋值了。 [Parameter(DefaultValue = 16)] public int SinMaPeriod { get; set; } //--周期输入,及初始值。MaCenterPeriod是周期参数 //若要添加其他自定参量:[Parameter(DefaultValue = 5)] public int LipsPeriods { get; set; } [Output("sinma", Color = Colors.Violet)] public IndicatorDataSeries sinma { get; set; } //--输出颜色--输出线的名称,输出线的取值---------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------- private TriangularMovingAverage sindata; //--------------sindata 的名称用于储存计算后的数组-------------------------------------------- protected override void Initialize() { sindata = Indicators.TriangularMovingAverage(MarketSeries.Close, SinMaPeriod); // Initialize and create nested indicators } public override void Calculate(int index) { // Calculate value at specified index // Result[index] = ... //Print the current value of _triangularMovingAverage to the log sinma[index] = sindata.Result[index]; //显示是通过数组,第一个是0:Print("Current Balance is {0}, Equity is {1}.", Account.Balance, Account.Equity); //--若是要提供偏移参看:Jaws[index + JawsShift] = jawsMa.Result[index]; } } }
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
// ç³»ç»èªå¨çè¯å¥------------------------------------------------------------------------------------
namespace cAlgo
{
// ææ ä¸è¬é½æ¯è¿ä¸ªè¯å¥----------------------------------------------------------
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
//--isoverlay æ¯å¦æ¾ç¤ºå¨å¾è¡¨ä¸ï¼utcæ¯æå¡å¨æ¶é´ãChinaStandardTimeå京æ¶é´ï¼ .noneä¸éè¦å¤çæï¼æï¼FullAccessãInternetï¼
public class SinMa : Indicator
{
//--å
¬ç¨ç±»------------TriangularMa æ¯ç±»å称èµå¼äºã
[Parameter(DefaultValue = 16)]
public int SinMaPeriod { get; set; }
//--å¨æè¾å
¥ï¼ååå§å¼ãMaCenterPeriodæ¯å¨æåæ°
//è¥è¦æ·»å å
¶ä»èªå®åéï¼[Parameter(DefaultValue = 5)] public int LipsPeriods { get; set; }
[Output("sinma", Color = Colors.Violet)]
public IndicatorDataSeries sinma { get; set; }
//--è¾åºé¢è²--è¾åºçº¿çå称ï¼è¾åºçº¿çåå¼----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
private TriangularMovingAverage sindata;
//--------------sindata çå称ç¨äºå¨å计ç®åçæ°ç»--------------------------------------------
protected override void Initialize()
{
sindata = Indicators.TriangularMovingAverage(MarketSeries.Close, SinMaPeriod);
// Initialize and create nested indicators
}
public override void Calculate(int index)
{
// Calculate value at specified index
// Result[index] = ...
//Print the current value of _triangularMovingAverage to the log
sinma[index] = sindata.Result[index];
//æ¾ç¤ºæ¯éè¿æ°ç»ï¼ç¬¬ä¸ä¸ªæ¯0ï¼Print("Current Balance is {0}, Equity is {1}.", Account.Balance, Account.Equity);
//--è¥æ¯è¦æä¾å移åçï¼Jaws[index + JawsShift] = jawsMa.Result[index];
}
}
}
metalsing
Joined on 06.03.2015
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: 三角TMA.algo
- Rating: 0
- Installs: 2445
- Modified: 13/10/2021 09:54
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
No comments found.