double value = MACD(12, 26, 9).Diff[0];
Print(Time[0].ToString() + "The current MACD DIFF value is " + value.ToString());
and comparing the output values printed with the statement above to whats going on in the chart, it's sometimes incorrect! This seems to happen with most Print statements.I use trying to get values from the chart. So when I'm programing an indi, it's working about 80% of the time.
So I have a simple IF statement:
if( MACD(12,26,9).Diff[0] >= .4 && MACD(12,26,9).Avg[0] > -.5 && MACD(12,26,9).Avg[0] < .5 && Close[0] >= EMA(20)[0] )
Draw.ArrowUp(this, CurrentBar.ToString(), true, 0, Low[0] - TickSize, Brushes.Lime);
and it occasionally puts the up arrow in a totally incorrect spot. That Macd.Diff[0] is definitely not over the .4 value in the picture attached
8/22/2022 9:09:07 AMThe current MACD DIFF value is -0.445061053749779
8/22/2022 9:09:07 AMThe current MACD AVG value is -0.459982212843787
8/22/2022 9:09:52 AMThe current MACD DIFF value is 0.423138811727991
8/22/2022 9:09:52 AMThe current MACD AVG value is -0.479593036466437
8/22/2022 9:09:56 AMThe current MACD DIFF value is 0.447511200504411
8/22/2022 9:09:56 AMThe current MACD AVG value is -0.367715236340334
8/22/2022 9:09:59 AMThe current MACD DIFF value is 0.458634870584208
8/22/2022 9:09:59 AMThe current MACD AVG value is -0.253056518694282
8/22/2022 9:10:03 AMThe current MACD DIFF value is 0.427917225736657
8/22/2022 9:10:03 AMThe current MACD AVG value is -0.146077212260117
8/22/2022 9:10:09 AMThe current MACD DIFF value is 0.403518046988103
8/22/2022 9:10:09 AMThe current MACD AVG value is -0.0451977005130917
8/22/2022 9:10:11 AMThe current MACD DIFF value is 0.415347338305496
8/22/2022 9:10:11 AMThe current MACD AVG value is 0.0586391340632824
8/22/2022 9:10:55 AMThe current MACD DIFF value is -0.409898082600649
8/22/2022 9:10:55 AMThe current MACD AVG value is 0.0734311354267453
8/22/2022 9:40:46 AMThe current MACD DIFF value is 0.435389947086998
8/22/2022 9:40:46 AMThe current MACD AVG value is 0.0191083602385957
this happens with all indi's that i'm trying to get a value from and using similar code to just place an arrow when the if statement is true.
why is there a mismatch between the output values and what is showing on the chart??
Comment