<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Forex Software — Use previous bar value (UPBV) question]]></title>
		<link>https://forexsb.com/forum/topic/8336/use-previous-bar-value-upbv-question/</link>
		<atom:link href="https://forexsb.com/forum/feed/rss/topic/8336/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Use previous bar value (UPBV) question.]]></description>
		<lastBuildDate>Mon, 13 Apr 2020 19:32:40 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Use previous bar value (UPBV) question]]></title>
			<link>https://forexsb.com/forum/post/60193/#p60193</link>
			<description><![CDATA[<p>Yes, Pinbar M is mine. The setting of PBV you see in FSB affects it in no way. Signal bar is not shifted, neither it is delayed. It uses closed bars, which value is known. And therefore it calculates and works reliably.</p>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Mon, 13 Apr 2020 19:32:40 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/60193/#p60193</guid>
		</item>
		<item>
			<title><![CDATA[Re: Use previous bar value (UPBV) question]]></title>
			<link>https://forexsb.com/forum/post/60191/#p60191</link>
			<description><![CDATA[<p>As I said before, some indicators apply the PBV later, when they actually calculate the signals. If you see the ATRStop indicator, it first calculates ATR and then uses the PBV when calculates the signal array `atrStop`.</p><p><a href="https://image-holder.forexsb.com/store/atr-stop-upbv.png"><span class="postimg"><img src="https://image-holder.forexsb.com/store/atr-stop-upbv-thumb.png" alt="https://image-holder.forexsb.com/store/atr-stop-upbv-thumb.png" /></span></a></p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Mon, 13 Apr 2020 16:54:53 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/60191/#p60191</guid>
		</item>
		<item>
			<title><![CDATA[Re: Use previous bar value (UPBV) question]]></title>
			<link>https://forexsb.com/forum/post/60189/#p60189</link>
			<description><![CDATA[<div class="quotebox"><cite>footon wrote:</cite><blockquote><p>It is C#, not C++ <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Can you give a real example from the indicators? It would help to explain better.</p><p>Secondly, previous bar value comes in to play in the logic calculation, where trading signals are raised. In some custom indis you might find PBV cut out and taken into account already in the indi value calculation block.</p><p>Thirdly, if only open prices are used in the calculation, PBV is not used, in FSB PBV is automatically switched off. If, for example, there are other price points used in addition (or without open prices), PBV is a must.</p><p>Taking into account those points above, in your abstract example case nr 1 doesn&#039;t seem to need the use of PBV, but the 2nd case needs it.</p><p>Finally, I would not describe it as a &quot;shift&quot;. It is extremely vital necessity for having a reliable and reproducible backtest result. It is a matter of using the latest <span class="bbu">confirmed</span> datapoints! It doesn&#039;t shift, but uses latest closed values, which do not change.</p></blockquote></div><p>Thanks for detailed answers!</p><p><span class="bbu">Example of indicator 1)</span> - Pinbar M (uses only Bar-1 values):<br /> for (int iBar = 1; iBar &lt; Bars; iBar++)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (Math.Abs(Close[iBar - 1] - Open[iBar - 1]) &lt; iPERCENT * 0.01 * (High[iBar - 1] - Low[iBar - 1]))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; doji[iBar] = 1;</p><br /><p><span class="bbu">Example of indicator 2)</span> - ATR (AverageTrueRange) - (uses High[bar], Low[bar]):<br /> for (int bar = 1; bar &lt; Bars; bar++)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; atr[bar] = Math.Max(High[bar], Close[bar - 1]) - Math.Min(Low[bar], Close[bar - 1]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; atr = MovingAverage(period, 0, maMethod, atr);</p>]]></description>
			<author><![CDATA[null@example.com (Finmod123)]]></author>
			<pubDate>Mon, 13 Apr 2020 13:25:33 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/60189/#p60189</guid>
		</item>
		<item>
			<title><![CDATA[Re: Use previous bar value (UPBV) question]]></title>
			<link>https://forexsb.com/forum/post/60187/#p60187</link>
			<description><![CDATA[<p>In addition to Footon&#039;s explanations, I may add that there is a difference between the values of the plotted line and the actual signals. The indicators show and plots their lines without PBV in order to look like as the MetaTrader indicators in the chart. The PBV is used when the indicator calculates the trading signals.</p>]]></description>
			<author><![CDATA[null@example.com (Popov)]]></author>
			<pubDate>Mon, 13 Apr 2020 12:52:23 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/60187/#p60187</guid>
		</item>
		<item>
			<title><![CDATA[Re: Use previous bar value (UPBV) question]]></title>
			<link>https://forexsb.com/forum/post/60186/#p60186</link>
			<description><![CDATA[<p>It is C#, not C++ <img src="https://forexsb.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>Can you give a real example from the indicators? It would help to explain better.</p><p>Secondly, previous bar value comes in to play in the logic calculation, where trading signals are raised. In some custom indis you might find PBV cut out and taken into account already in the indi value calculation block.</p><p>Thirdly, if only open prices are used in the calculation, PBV is not used, in FSB PBV is automatically switched off. If, for example, there are other price points used in addition (or without open prices), PBV is a must.</p><p>Taking into account those points above, in your abstract example case nr 1 doesn&#039;t seem to need the use of PBV, but the 2nd case needs it.</p><p>Finally, I would not describe it as a &quot;shift&quot;. It is extremely vital necessity for having a reliable and reproducible backtest result. It is a matter of using the latest <span class="bbu">confirmed</span> datapoints! It doesn&#039;t shift, but uses latest closed values, which do not change.</p>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Mon, 13 Apr 2020 12:42:17 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/60186/#p60186</guid>
		</item>
		<item>
			<title><![CDATA[Use previous bar value (UPBV) question]]></title>
			<link>https://forexsb.com/forum/post/60185/#p60185</link>
			<description><![CDATA[<p>Hello traders!</p><p>I have noticed 2 different versions of indicators by C++ code: <br />1) Indicator [bar] = Function of O, H, L, C [bar-1, bar-2, bar-3…..]<br />2) Indicator [bar] = Function of O,H, L, C [bar, bar-1, bar-2, bar-3,...]<br /><span class="bbu"><br />Question:</span><br />If we use UPBV=true and indicator 1): will the result be shifted by 2 bars ? (1 bar in C++ code and 1 bar by means of UPBV = true)</p>]]></description>
			<author><![CDATA[null@example.com (Finmod123)]]></author>
			<pubDate>Mon, 13 Apr 2020 12:26:37 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/60185/#p60185</guid>
		</item>
	</channel>
</rss>
