Search results

  1. D

    Calculating ATR

    Brian, I appreciate your time and help. And I get your point. One point I forgot to mention: The txt file does not only contain data for one stock but for many more, thus it has >300,000 rows. Thus, we have to make some pre-selection of the data before I can calculate something on a worksheet...
  2. D

    Calculating ATR

    Brian, as per your question: At the end of the day I would like to have a tool with which I can screen stocks on any date according to certain ATR criteria. And I feel that any query solution is much faster than other array-based solutions. Besides that I also need to learn SQL... Thanks...
  3. D

    Calculating ATR

    Hi Namliam, yes, you are right and thank you for your help - it really helps me to learn everything step by step. I've "translated" now your suggestion, however Excel (with which I run the query) just hangs up with no error message... I guess that there is a problem when I run such a query...
  4. D

    Calculating ATR

    Hi Brian, I'm not sure what you mean... The final result will be used in Excel and the data source is a txt-file. However, I want to use SQL to retrieve the data (thus the question in this forum). Usually I try out my SQL statements in Access but eventually use Excel as I know it better...
  5. D

    Calculating ATR

    What I am trying to do: (1) For date t=0 I need the difference between High and Low. That's done by Query one. Then I need (2) the (absolute) difference between the Close of t-1 and the High of t=0 and (3) the Low of t=0, respectively. The High and Low are coming from Query 1 and the Close...
  6. D

    Calculating ATR

    Well spotted. ;) We are indeed working together on this problem. Regarding the question: I / we want to have the result for each of the last 60 trading days. And I guess there is an alternative way than just repeating the query just 60 times... Diana
  7. D

    Calculating ATR

    Dear All, I need some help with my SQL query... I am trying to build a SQL query with which I can calculate the so-called Average True Range (ATR) (-> http://stockcharts.com/help/doku.php?id=chart_school:technical_indicators:average_true_range_a). I have a table which contains stock prices...
  8. D

    Max of two queries

    Thank you. Jal, Brian, thank you very much for your help. The code now works. Best regards Diana
  9. D

    Max of two queries

    Thanks Brian... I think I am close to the solution now... Splitting it up is a good idea. In VBA it now looks like that: Dim query1 As String query1 = "SELECT Ticker, Close FROM 5401.txt WHERE dDate = #11/28/2008# GROUP BY Ticker, dDate, Close" Dim query2 As String query2 = "SELECT TOP 20...
  10. D

    Max of two queries

    Brian, thanks for your help. Re the first comment - you are right. It's actually easier to just do it for the Top21 values. Re the second comment - I have tried to put together the following request: SELECT Ticker, dDate FROM ( SELECT Ticker, MAX(Close) AS MaxOfClose FROM...
  11. D

    Max of two queries

    Dear All, I am not the SQL expert and I would be very happy if someone could help me with the following question: The first query gives me the closing price of the last trading day (here just 11/28/08): SELECT Ticker, Close FROM Data WHERE dDate=#11/28/2008# GROUP BY Ticker, dDate, Close...
  12. D

    Top X Query

    I see. Thank you, it works now! Diana
  13. D

    Top X Query

    Hi Brian, thanks for your reply. I'm not sure what you mean... Could you please give me an example? Diana
  14. D

    Top X Query

    Hi there, the following query retrieves the Top 20 values of "Mcap": SELECT TOP 20 D.Mcap FROM Data as D WHERE ... ORDER BY Mcap DESC How do I have to modify the code so that I get the sum of the Top 20 values of Mcap? Thank you for your help... Diana
  15. D

    Importing data from text file via SQL

    I'd say use ' instead of ""? Diana
  16. D

    DatDiff - Working days only?

    Thank you. Thank you very much! Diana
  17. D

    DatDiff - Working days only?

    Thank you. Thank you to all of you for your help! Keith, do you remember where you posted it? Regards Diana
  18. D

    DatDiff - Working days only?

    Hi, is there any alternative of the DatDiff function, which counts only working days between two given dates? Regards, Diana
  19. D

    1:n relationship changes to m:n

    Thank you! Diana
  20. D

    1:n relationship changes to m:n

    Thank you very much for your reply. This is the output I want to get: Order# Article# Description 1 A Text1 2 B Text2 3 A Text1 Although tbOrders uses the new Article#New, the result of my query should give the...
Back
Top Bottom