Community Member
Member Avatar
Hi All,

All of my programming was done in Visual Studio Express 2008 version. Thinking of upgrading to 2015 now that I have a Win 10 machine and given that I want to start learning some of the new functionality re C++ 11 and 14.

Any tips/thoughts on how to … Topic by toneranger in Software Development
c++
Member Avatar
Hi All,

All of my programming was done in Visual Studio Express 2008 version. Thinking of upgrading to 2015 now that I have a Win 10 machine and given that I want to start learning some of the new functionality re C++ 11 and 14.

Any tips/thoughts on how to … First Post in Topic by toneranger in Software Development
c++
Member Avatar
Hello,

My function below is part of a program that compiles and runs. The core of the program is in the function below. The issue is that the variable named "PNL" below as well as "CumLoss" and "CumProfit" don't reset to 0 when the loop "L" restarts. So the output … Topic by toneranger in Software Development
c++
Member Avatar
Hello,

My function below is part of a program that compiles and runs. The core of the program is in the function below. The issue is that the variable named "PNL" below as well as "CumLoss" and "CumProfit" don't reset to 0 when the loop "L" restarts. So the output … Topic by toneranger in Software Development
c++
Member Avatar
Hello,

My function below is part of a program that compiles and runs. The core of the program is in the function below. The issue is that the variable named "PNL" below as well as "CumLoss" and "CumProfit" don't reset to 0 when the loop "L" restarts. So the output … Topic by toneranger in Software Development
c++
Member Avatar
toneranger Replied To a Post in iterator access for sum-=
Topic by toneranger in Software Development
Never mind guys, I figured it out. Reply by toneranger
Member Avatar
toneranger Marked Solved Status for iterator access for sum-=
Hi,

I'm trying to compute a moving average of length 20. I've got a vector of structs that's read into my function and I'm using an iterator to read through as follows:



int length = a;
int count = 0;
double sum = 0;

while (itr!= priceinput.end())

{
sum += … Topic by toneranger in Software Development
Member Avatar
Hi,

I'm trying to compute a moving average of length 20. I've got a vector of structs that's read into my function and I'm using an iterator to read through as follows:



int length = a;
int count = 0;
double sum = 0;

while (itr!= priceinput.end())

{
sum += … Topic by toneranger in Software Development
Member Avatar
Topic by toneranger in Software Development
that's why I chose small input data files, so I could manually eyeball them. The 5min data file looks fine. The issue must be the program because it outputs the first analysis output file to the directory, but it doesn't output the moving average output file.

Actually on second thought: … Reply by toneranger
Member Avatar
Topic by toneranger in Software Development
the program reads in the data from the txt file, then it does some analysis on the data in the main function, outputting to a txt file. Then there is more analysis i.e., the moving average function (which i posted above) which also outputs to a txt file, the "MA.txt" … Reply by toneranger
Member Avatar
Topic by toneranger in Software Development
Tried it with another 5 min file which ends with a blank line and no luck, still aborts. I've attached below:

So, I noticed that the code gets through the first function in my "main", because it appends the data to a file, but it doesn't make it to my … Reply by toneranger
Member Avatar
Topic by toneranger in Software Development
Nullptr,

I changed the NamedSwings to the dereferenced iterator as you suggested, but still the same abort at runtime. I checked out what you said earlier about this line:

0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x09 0x0D 0x0A

And it looks like it's a bunch of \n \r … Reply by toneranger
Member Avatar
Topic by toneranger in Software Development
Hi David,

I found this code below online and gave it a try to read the last line in each of the two files. In the file that works, "csv file.txt", the output to the below is nothing, i.e., an empty line. In the file that doesn't work, "09five.txt", the … Reply by toneranger
Member Avatar
Topic by toneranger in Software Development
I attached a new 5 min file i tried with, but no luck. I made this one to be only a few days long with no extraneous lines in it. But still aborting at runtime, frustrating. Reply by toneranger
Member Avatar
Topic by toneranger in Software Development
David and Nullptr,

Thanks. Nullptr, sorry for the silly question, how did you get to 'see' those bytes? And what can I do to fix the file? I basically have the data in a much larger excel file that spans 3 months. So if I only want to use a … Reply by toneranger
Member Avatar
Topic by toneranger in Software Development
David,

I looked at the five mintest.txt file in notepad and didn't notice anything unusual. What I see is two days worth of data, spanning 9/9/2010 to 9/10/2010. Did you see something else?

Thanks. Reply by toneranger
Member Avatar
Topic by toneranger in Software Development
Hi David,

Thanks much for your thoughts. Well, both files are small samples, covering a few days worth of data only. I tried the indirection above but that caused a compile error, so it's not the code above.

I'm attaching the two files below Reply by toneranger
Member Avatar
Hi,

I'm wondering what could cause this type of runtime error:

My program basically reads data from different kinds of data files, either a minute data file or a 5 minute data file and then does some analysis. When I run the program on the 1 min data, no problem. … Topic by toneranger in Software Development
Member Avatar
Topic by toneranger in Software Development
c++
Thank you Nullptr, that worked perfect. Reply by toneranger
Member Avatar
Topic by toneranger in Software Development
c++
Thank you Suzie.

You mean checking as in something like this?

if (hr == S_OK) ? Reply by toneranger
Member Avatar


Hi,

I'm new to APIs. Got the code below to compile (with 3 warnings C4129) but it won't output to the designated path. I created the txt file ahead of time, nqquotes.txt, but after the code compiles, that file stays empty.

Thanks for your help,
TR


#include "stdafx.h"
#include <tchar.h> … Topic by toneranger in Software Development
c++