DataTable
Author: grtrader
Creation Date: 2/16/2018 1:05 PM
profile picture

grtrader

#1
I tried to use DataTable with "using System.Data" but got error that the namespaces do not exist. Can you shed any light on this?

Thanks
profile picture

Eugene

#2
In .NET you have to add a reference to System.Data (or other relevant assembly in the GAC or from a DLL file) before using it. See "References..." dialog in your Strategy (more in the User Guide). Note that it's applied on per Strategy basis.

Out of curiosity, what are you trying to achieve with DataTable?
profile picture

grtrader

#3
I am trying to develop a method to draw trendlines for lets say the last 5 or 10 bars off off the highs and lows to determine the pattern, ie. triangle, etc. and also determine the breakout.

I have don't know if my idea will work, but I want to try it:

1. Start with the linear regression for the time period.
2. Define the line (y=mx +b) from the regression.
3. Store these values for each bar.
3. Subtract the regression line value from each respective bar's high.
4. Determine the highest and second highest differences and draw an extended line between the highs of the respective bars.
5. Repeat the same for the lows.

I have started out using an array, but came on a problem as to sorting for the two highest differences and found out that if I use a table, I would be able to sort easily (I hope). I am learning programming C# and know I will never get as proficient in programming as you and Cone and appreciate all of your work - a lot of excellent programming examples. Wealth Lab provides and opportunity to try out new ideas.

Maybe you have already figured out how to do the above procedure.
profile picture

Eugene

#4
Thank you for your kind words. This motivates us technicians to learn and share.

I'd say that sorting and related operations are more easily done with LINQ. Let's get started with your task step by step.

1. Obvious
2. How do you define this value on a bar by bar basis?
3. A DataSeries
4. (again)
5. What is the "difference" exactly? Why are there multiple differences?
6. -"-"-

Some code in another language or formula might bring some light.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).