Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Thanks for taking a stab at it Sunpost... who wrote..
int InstPeriod = 0;
int Value4 = 0;
for (int count = 0; count <= 50; count++)
{
Value4 =+ DeltaPhase[count];
if (Value4 > 360 && InstPeriod == 0)
{
InstPeriod = count;
}
}
DeltaPhase is just a double, so I dropped the [count] from DeltaPhase[count] in your answeras that would not compile... looks like the compiler was thinking the [count] was addressing an array... so I have this now...
//Sum DeltaPhases to reach 360 degrees. The sum is the instantaneous period.
InstPeriod = 0;
Value4 = 0;
The DrawTexts I'm using for debugging... What's happening is that DeltaPhase gets added to Value4 once, and gets drawn, but then the if statement never executes... I believe because the loop doesn't run, doesn't keep adding DeltaPhase to Value4, so Value 4 never gets greater than 360 for the if statement to evaluate to true.
The issue with the statements in the if not being reached after the first time is that InstPeriod gets set to a value other than 0 making the condition (InstPeriod == 0) false.
I got the loop running.... indicator doesn't look right, but at least its plotting something other than 0. I probably have something wrong up in the ArcTangent math to debug...