Topics
Replies
ErikD
24 Jan 2014, 01:14
// ------------------------------------------------------------------------------- // // This will draw the value of the ADX on the chart // // ------------------------------------------------------------------------------- using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; namespace cAlgo.Indicators { [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC)] public class DrawSpread : Indicator { [Parameter(DefaultValue = 25)] public int Period { get; set; } private DirectionalMovementSystem _dms; protected override void Initialize() { _dms = Indicators.DirectionalMovementSystem(Period); } public override void Calculate(int index) { DisplayADXChart(); } private void DisplayADXChart() { string text = string.Format("ADX: {0}", _dms.ADX.LastValue); ChartObjects.DrawText("Label", "ADX:", StaticPosition.TopLeft, Colors.Yellow); ChartObjects.DrawText("adx", text.PadLeft(12), StaticPosition.TopLeft, Colors.White); } } }
@ErikD
ErikD
15 Jan 2014, 15:45
Thank you for this!
A thought, if this was put in an indicator window wouldn't it be possible to make it time independent?, sort of like the Tick indicator
This should also serve as a message to the team at Spotware, Platform is awesome (best platform atm next to TS) but you have been "implementing" some functions for almost a year.
Infact it has been o long so that a user took it on to him to create his own :/
@ErikD
ErikD
12 Dec 2013, 19:12
RE:
Spotware said:
Remove this line from Initialize:
Wave = CreateDataSeries();and add this to the beginning of the Calculate method:
if (index < Period) { HP[index] = 0; Filt[index] = 0; return; }Instead of if (index >= Period)
Thank you this fixed the problem
Just to be clear
It fixed the problem by populating HP and Filt when the index is bigger than the period.
Does this always have to be done when dealing with calculations that need the past value of it self in order to complete?
@ErikD
ErikD
12 Dec 2013, 13:26
Ok so I didnt manage to get it to work...
Seems like there is something wrong with the calculation
HP[index] = 0.5 * (1 + alpha1) * (Source[index] - Source[index - 1]) + alpha1 * HP[index - 1];
It does however work in my tradestation where it looks like this
HP = .5*(1 + alpha1)*(Close - Close[1]) + alpha1*HP[1];
anyone know what might be wrong?
@ErikD
ErikD
30 Jul 2013, 21:57
Thanks for the reply Atrader
The indicator is a convertaion from one of Ehlers papers
Its basicly a HighPass filter that is supposed to filter out signals over a higher noumber (default should be 48) that is then smootherd by what ehlers call a super smoother.
The indicator can be used as a standalone indicator but I have found that it is best used as a scourse for other osciliators (I have TS aswell)
The code looks good and I can tell from the indicator that it produces the result that I want, only that the period is to slow which make it that messy.
I'll see if I can find the paper and link it, the formula is in there but its basicly what I wrote in the code.
Could be with the way EasyLaunge and C prioritize code.
The alternative is that I use a libary with signal codes such as SignalLab but I rahter not :P
@ErikD
ErikD
11 Jun 2013, 17:02
( Updated at: 21 Dec 2023, 09:20 )
RE:
For some unknown reson my cAlgo just wont start, everything was fine and then it wasent.
No updates or anything done in the application
I get an error message
#31590622
Anyone know what how I can solve it?
Heres the image
Heres the image
@ErikD
ErikD
24 Feb 2014, 01:21
Most likely was the database connection lost somewhere
I go the same problem, mine however happened DURING trading (was almost a disaster for me)
@ErikD