CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2016
    Posts
    3

    Question Can someone kindly explain what these code mean

    Please explain what these codes do in plain English .

    [code]




    If (data.getRecordCount < 20) Then
    data.CloseDatabase
    Else

    Dim average As New MovingAverage
    Dim set As New RecordSet
    Dim set2 As New RecordSet
    [set] = average.ExponentialMovingAverage(data, set3.getField("High"), 2, "A")
    set2 = average.ExponentialMovingAverage(data, set3.getField("Low"), 2, "A")
    Last edited by Sam.chris; October 31st, 2016 at 11:03 AM. Reason: shorter code

  2. #2
    Join Date
    Oct 2016
    Posts
    3

    Re: Can someone kindly explain what these codes mean

    So many Views and no replies

  3. #3
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: Can someone kindly explain what these codes mean

    Unfortunately I'm not a VB programmer so can't really help - as it would just be a guess.
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Can someone kindly explain what these codes mean

    It's not VB6, anyways
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Can someone kindly explain what these codes mean

    First of all it is code not codes, secondly it is VB.Net not VB6 or older.
    I have moved the thread to the correct section of the forum.

    As for explaining the code, sorry but that would take a good bit of time to fully explain what each line does.
    Always use [code][/code] tags when posting code.

  6. #6
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Can someone kindly explain what these codes mean

    It is quite difficult to explain precisely as we do not know in which context you are using this code. Obviously you didn't find this code out of the blue, you must have searched for some sort of solution and found this.
    It seems as if the code opens a database file and / or a CSV file

  7. #7
    Join Date
    Oct 2016
    Posts
    3

    Re: Can someone kindly explain what these codes mean

    [set] = average.ExponentialMovingAverage(data, set3.getField("High"), 2, "A")
    set2 = average.ExponentialMovingAverage(data, set3.getField("Low"), 2, "A")

    Thanks to all who responded, have shortened the code . My understanding is its a EMA of 2 periods, am I right ? and what does "A" mean here.
    Last edited by Sam.chris; October 31st, 2016 at 11:17 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured