Scale levels not showing up
Created at 05 Aug 2015, 11:01
Scale levels not showing up
05 Aug 2015, 11:01
I'm trying to modify this TEMA indicator /algos/indicators/show/15 . As part of it I wanted to add in more levels on the scale. But I'm having trouble getting the levels to show up. They appear on some symbols and not others.
EG here:
https://puu.sh/jq11F/e467d70da7.png
It's working fine and the levels are showing up.
Then here on EUR/USD I'm getting the right line but no levels marked.
https://puu.sh/jq154/adb8dc004e.png
using System; using cAlgo.API; using cAlgo.API.Indicators; namespace cAlgo.Indicators { [Levels(0.001, 0.002, 0.003, 0.004, 0.005, 0.006, 0.007, 0.008, 0.009, 0.01, 0, -0.001, -0.002, -0.003, -0.004, -0.005, -0.006, -0.007, -0.008, -0.009, -0.01)] [Indicator(IsOverlay = false, AccessRights = AccessRights.None, AutoRescale = true, ScalePrecision = 3)] public class TEMA : Indicator { [Output("TEMA")] public IndicatorDataSeries tema { get; set; } [Parameter("Data Source")] public DataSeries DataSource { get; set; } [Parameter("Periods", DefaultValue = 14)] public int Period { get; set; } private ExponentialMovingAverage ema1; private ExponentialMovingAverage ema2; private ExponentialMovingAverage ema3; protected override void Initialize() { ema1 = Indicators.ExponentialMovingAverage(DataSource, Period); ema2 = Indicators.ExponentialMovingAverage(ema1.Result, Period); ema3 = Indicators.ExponentialMovingAverage(ema2.Result, Period); } public override void Calculate(int index) { tema[index] = ema3.Result[index] - ema3.Result[index - 1]; } } }
Any tips on where I'm going wrong?
Spotware
17 Aug 2015, 17:16
Dear Trader,
The values of your indicator are too small. The indicator is drawn on the panel which is auto scaled to show the indicator on the best scale according to its minimum, maximum values. The values that you are assigning to the indicator are between 0.001...> index > -0.001. Therefore the marked levels are over/above the indicator panel.
For your information an easy way to check whether something is wrong, is to print the value to the log and check if it’s the expected value.
@Spotware