<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Forex Software — Indicator Calculations]]></title>
		<link>https://forexsb.com/forum/topic/2306/indicator-calculations/</link>
		<atom:link href="https://forexsb.com/forum/feed/rss/topic/2306/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Indicator Calculations.]]></description>
		<lastBuildDate>Fri, 20 May 2011 15:35:44 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Indicator Calculations]]></title>
			<link>https://forexsb.com/forum/post/9231/#p9231</link>
			<description><![CDATA[<p>Never mind, I just realised I had the wrong period in the two momentum. duh!!</p>]]></description>
			<author><![CDATA[null@example.com (i4xtoo)]]></author>
			<pubDate>Fri, 20 May 2011 15:35:44 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/9231/#p9231</guid>
		</item>
		<item>
			<title><![CDATA[Indicator Calculations]]></title>
			<link>https://forexsb.com/forum/post/9229/#p9229</link>
			<description><![CDATA[<p>Hi guys,<br />I need help understanding the logic behind the calcs for Osc of Momentum. Please, correct me if I am wrong. What this indicator does is calculate two momentum and substract the second from the first(as in the last for loop). Am I understanding the code correctly? Because I must be missing something, If I insert the two momentum in the chart, there is no way I can get the Oscillator value by just substractin one from the other. Are there other separated class for oscillators that is in other place? </p><br /><br /><p> /// &lt;summary&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; /// Calculates the indicator&#039;s components<br />&nbsp; &nbsp; &nbsp; &nbsp; /// &lt;/summary&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; public override void Calculate(SlotTypes slotType)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Reading the parameters<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MAMethod&nbsp; maMethod&nbsp; = (MAMethod)IndParam.ListParam[1].Index;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BasePrice basePrice = (BasePrice)IndParam.ListParam[2].Index;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int iPeriod1 = (int)IndParam.NumParam[0].Value;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int iPeriod2 = (int)IndParam.NumParam[1].Value;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int iPrvs&nbsp; &nbsp; = IndParam.CheckParam[0].Checked ? 1 : 0;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Calculation<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int iFirstBar = iPeriod1 + iPeriod2 + 2;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double[] adIndicator1 = new double[Bars];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double[] adIndicator2 = new double[Bars];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double[] adOscllator&nbsp; = new double[Bars];</p><p>// ---------------------------------------------------------<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum Momentum1 = new Momentum(slotType);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum1.IndParam.ListParam[1].Index = IndParam.ListParam[1].Index;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum1.IndParam.ListParam[2].Index = IndParam.ListParam[2].Index;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum1.IndParam.NumParam[0].Value = IndParam.NumParam[0].Value;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum1.IndParam.CheckParam[0].Checked = IndParam.CheckParam[0].Checked;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum1.Calculate(slotType);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum Momentum2 = new Momentum(slotType);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum2.IndParam.ListParam[1].Index = IndParam.ListParam[1].Index;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum2.IndParam.ListParam[2].Index = IndParam.ListParam[2].Index;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum2.IndParam.NumParam[0].Value = IndParam.NumParam[1].Value;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum2.IndParam.CheckParam[0].Checked = IndParam.CheckParam[0].Checked;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Momentum2.Calculate(slotType);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adIndicator1 = Momentum1.Component[0].Value;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adIndicator2 = Momentum2.Component[0].Value;<br />// ----------------------------------------------------------</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (int iBar = iFirstBar; iBar &lt; Bars; iBar++)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adOscllator[iBar] = adIndicator1[iBar] - adIndicator2[iBar];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>]]></description>
			<author><![CDATA[null@example.com (i4xtoo)]]></author>
			<pubDate>Fri, 20 May 2011 13:58:37 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/9229/#p9229</guid>
		</item>
	</channel>
</rss>
