<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>DailyFX Forum - Indicator SDK Support</title>
		<link>http://forexforums.dailyfx.com</link>
		<description />
		<language>en</language>
		<lastBuildDate>Sat, 21 Nov 2009 14:19:31 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://forexforums.dailyfx.com/images/dfx2009/misc/rss.jpg</url>
			<title>DailyFX Forum - Indicator SDK Support</title>
			<link>http://forexforums.dailyfx.com</link>
		</image>
		<item>
			<title>how to get data for backtesting easier?</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/122438-how-get-data-backtesting-easier.html</link>
			<pubDate>Mon, 09 Nov 2009 03:36:39 GMT</pubDate>
			<description>Hi, 
For now, I get fxcm data week by week by...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
For now, I get fxcm data week by week by logging in on Saturday, opening my preferred crosses in Marketscope 2.0, then selecting File&gt;Export...&gt;Export to Excel. I enlarge the chart to encompass the whole week, and usually get a few data points from the previous week's Friday. Then I edit the resulting file to cut off the extra data from the previous Friday (select the lines in a text editor and delete).<br />
I was wondering if there is a more convenient way to get this file? Also, is there a way to export data from a larger timeframe? The maximum I got from enlarging the chart was about 3 months of 5-minute data.<br />
Thanks</div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>gorak</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/122438-how-get-data-backtesting-easier.html</guid>
		</item>
		<item>
			<title>Testing on the weekend?</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/119324-testing-weekend.html</link>
			<pubDate>Sat, 31 Oct 2009 06:36:52 GMT</pubDate>
			<description>Is there any way to view custom indicators in...</description>
			<content:encoded><![CDATA[<div>Is there any way to view custom indicators in Marketscope on the weekend?  (Using historical data, of course.)</div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>reidwatkins</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/119324-testing-weekend.html</guid>
		</item>
		<item>
			<title><![CDATA[Is there a 'c' interface available?]]></title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/113860-there-c-interface-available.html</link>
			<pubDate>Wed, 21 Oct 2009 03:07:09 GMT</pubDate>
			<description><![CDATA[Can one call 'c' functions from the indicator sdk...]]></description>
			<content:encoded><![CDATA[<div>Can one call 'c' functions from the indicator sdk lua implementation?</div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>jfitz1959</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/113860-there-c-interface-available.html</guid>
		</item>
		<item>
			<title>Example: Demarker</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/109594-example-demarker.html</link>
			<pubDate>Mon, 12 Oct 2009 18:18:17 GMT</pubDate>
			<description>Here is a source code for the DeMarker oscillator...</description>
			<content:encoded><![CDATA[<div>Here is a source code for the DeMarker oscillator as it is described at <a href="http://www.metaquotes.net/techanalysis/indicators/demarker/" target="_blank">DeMarker — Technical Indicators, Technical Analysis</a>.<br />
<br />
1) Create the file dem.lua<br />
2) Copy the code below into this file<br />
3) Save the file<br />
or<br />
1,2,3) Just right-click on <a href="http://www.gehtsoftusa.com/bin/indicators/dem.lua" target="_blank">this link</a> and choose &quot;Save As...&quot; from the menu.<br />
<br />
4) Go to &quot;Charts/Chart/Manage Custom Indicators&quot; menu of the Trading Station<br />
5) Click &quot;Load&quot;<br />
6) Choose the dem.lua file created at the previous steps<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">-- initializes the indicator<br />
function Init()<br />
&nbsp; &nbsp; indicator:name(&quot;DeMarker&quot;);<br />
&nbsp; &nbsp; indicator:description(&quot;&quot;)<br />
&nbsp; &nbsp; indicator:requiredSource(core.Bar);<br />
&nbsp; &nbsp; indicator:type(core.Oscillator);<br />
<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;N&quot;, &quot;Number of periods for smoothing&quot;, &quot;&quot;, 14);<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;C&quot;, &quot;Color of the oscillator&quot;, &quot;&quot;, core.rgb(0, 127, 127));<br />
end<br />
<br />
local source;<br />
local first;<br />
local out;<br />
local max;<br />
local min;<br />
local smax;<br />
local smin;<br />
local n;<br />
<br />
-- process parameters and prepare for calculations<br />
function Prepare()<br />
&nbsp; &nbsp; n = instance.parameters.N;<br />
&nbsp; &nbsp; source = instance.source;<br />
<br />
&nbsp; &nbsp; max = instance:addInternalStream(source:first() + 1);<br />
&nbsp; &nbsp; min = instance:addInternalStream(source:first() + 1);<br />
&nbsp; &nbsp; smax = core.indicators:create(&quot;MVA&quot;, max, n, core.rgb(0, 0, 0));<br />
&nbsp; &nbsp; smin = core.indicators:create(&quot;MVA&quot;, min, n, core.rgb(0, 0, 0));<br />
&nbsp; &nbsp; first = smax.DATA:first();<br />
&nbsp; &nbsp; name = profile:id() .. &quot;(&quot; .. n .. &quot;)&quot;;<br />
&nbsp; &nbsp; instance:name(name);<br />
&nbsp; &nbsp; out = instance:addStream(&quot;DeM&quot;, core.Line, name .. &quot;.DeM&quot;, &quot;DeM&quot;, instance.parameters.C, first);<br />
&nbsp; &nbsp; out:addLevel(0);<br />
&nbsp; &nbsp; out:addLevel(0.3);<br />
&nbsp; &nbsp; out:addLevel(0.5);<br />
&nbsp; &nbsp; out:addLevel(0.7);<br />
&nbsp; &nbsp; out:addLevel(1);<br />
end<br />
<br />
-- Indicator calculation routine<br />
function Update(period, mode)<br />
&nbsp; &nbsp; if (period &gt; source:first() + 1) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (source.high[period] &gt; source.high[period - 1]) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; max[period] = source.high[period] - source.high[period - 1]<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; max[period] = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (source.low[period] &lt; source.low[period - 1]) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min[period] = source.low[period - 1] - source.low[period];<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; min[period] = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; end<br />
&nbsp; &nbsp; smax:update(mode);<br />
&nbsp; &nbsp; smin:update(mode);<br />
&nbsp; &nbsp; if (period &gt;= first) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; local vmax;<br />
&nbsp; &nbsp; &nbsp; &nbsp; local vmin;<br />
&nbsp; &nbsp; &nbsp; &nbsp; vmax = smax.DATA[period];<br />
&nbsp; &nbsp; &nbsp; &nbsp; vmin = smin.DATA[period];<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (vmax == 0 and vmin == 0) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; out[period] = nil;<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; out[period] = vmax / (vmax + vmin);<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; end<br />
end</code><hr />
</div></div>


	<br />
	<div style="padding:6px">

	
		<fieldset class="fieldset">
			<legend>Attached Thumbnails</legend>
			<div style="padding:3px">
			
<a href="http://forexforums.dailyfx.com/attachments/indicator-sdk-support/38950d1255371443-example-demarker-snapshot.jpg" rel="Lightbox_356989" id="attachment38950" target="_blank"><img class="thumbnail" src="http://forexforums.dailyfx.com/attachments/indicator-sdk-support/38950d1255371443t-example-demarker-snapshot.jpg" border="0" alt="Click image for larger version

Name:	snapshot.jpg
Views:	N/A
Size:	46.9 KB
ID:	38950" /></a>
&nbsp;<br /><br />

			</div>
		</fieldset>
	

	

	

	

	</div>
]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>Nikolay.Gekht</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/109594-example-demarker.html</guid>
		</item>
		<item>
			<title>Example: Fractal Indicator</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/109587-example-fractal-indicator.html</link>
			<pubDate>Mon, 12 Oct 2009 17:51:36 GMT</pubDate>
			<description>Here is a source code for the Bill Williams 5-bar...</description>
			<content:encoded><![CDATA[<div>Here is a source code for the Bill Williams 5-bar Fractal oscillator as it is described at <a href="http://www.metaquotes.net/techanalysis/indicators/fractal" target="_blank">Fractals &#8212; Technical Indicators, Technical Analysis</a><br />
<br />
1) Create the file fractal.lua<br />
2) Copy the code below into this file<br />
3) Save the file<br />
or<br />
1,2,3) Just right-click on <a href="http://www.gehtsoftusa.com/bin/indicators/fractal.lua" target="_blank">this link</a> and choose &quot;Save As...&quot; from the menu.<br />
<br />
4) Go to &quot;Charts/Chart/Manage Custom Indicators&quot; menu of the Trading Station<br />
5) Click &quot;Load&quot;<br />
6) Choose the fractal.lua file created at the previous steps<br />
<br />
Unfortunately, the current version of the Marketscope does not support the labels, so, the fractals <br />
are specified as the red (up) or green (down) bars in the oscillator area.<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">function Init()<br />
&nbsp; &nbsp; indicator:name(&quot;Fractal&quot;);<br />
&nbsp; &nbsp; indicator:description(&quot;Bill Williams Fractal oscillator&quot;)<br />
&nbsp; &nbsp; indicator:requiredSource(core.Bar);<br />
&nbsp; &nbsp; indicator:type(core.Oscillator);<br />
<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;UpC&quot;, &quot;Color of the up fractal&quot;, &quot;&quot;, core.rgb(255, 0, 0));<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;DownC&quot;, &quot;Color of the down fractal&quot;, &quot;&quot;, core.rgb(0, 255, 0));<br />
end<br />
<br />
local source;<br />
local up, down;<br />
<br />
function Prepare()<br />
&nbsp; &nbsp; source = instance.source;<br />
&nbsp; &nbsp; local name = profile:id();<br />
&nbsp; &nbsp; instance:name(name);<br />
&nbsp; &nbsp; up = instance:addStream(&quot;Up&quot;, core.Bar, name .. &quot;.Up&quot;, &quot;Up&quot;, instance.parameters.UpC, 4, -2);<br />
&nbsp; &nbsp; up:addLevel(1);<br />
&nbsp; &nbsp; up:addLevel(0);<br />
&nbsp; &nbsp; up:addLevel(-1);<br />
&nbsp; &nbsp; down = instance:addStream(&quot;Down&quot;, core.Bar, name .. &quot;.Down&quot;, &quot;Down&quot;, instance.parameters.DownC, 4, -2);<br />
end<br />
<br />
function Update(period, mode)<br />
&nbsp; &nbsp; if (period &gt; 6) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; local curr = source.high[period - 2];<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (curr &gt; source.high[period - 4] and curr &gt; source.high[period - 3] and<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curr &gt; source.high[period - 1] and curr &gt; source.high[period]) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; up[period - 2] = 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; up[period - 2] = nil;<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; &nbsp; &nbsp; curr = source.low[period - 2];<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (curr &lt; source.low[period - 4] and curr &lt; source.low[period - 3] and<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; curr &lt; source.low[period - 1] and curr &lt; source.low[period]) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; down[period - 2] = -1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; down[period - 2] = nil;<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; end<br />
end</code><hr />
</div></div>


	<br />
	<div style="padding:6px">

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
			<div style="padding:3px">
			<img class="attach" src="http://forexforums.dailyfx.com/attachments/indicator-sdk-support/38944d1255369821-example-fractal-indicator-fractal.png" border="0" alt="" />&nbsp;
			</div>
		</fieldset>
	

	

	

	</div>
]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>Nikolay.Gekht</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/109587-example-fractal-indicator.html</guid>
		</item>
		<item>
			<title>Line Studies</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/108786-line-studies.html</link>
			<pubDate>Thu, 08 Oct 2009 17:28:41 GMT</pubDate>
			<description>Can lines that are drawn on the chart be...</description>
			<content:encoded><![CDATA[<div>Can lines that are drawn on the chart be referenced by the Lua code?</div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>jonnroc</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/108786-line-studies.html</guid>
		</item>
		<item>
			<title>Example: Gator</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/105241-example-gator.html</link>
			<pubDate>Wed, 23 Sep 2009 21:55:45 GMT</pubDate>
			<description>Here is a source code for the GATOR oscillator as...</description>
			<content:encoded><![CDATA[<div>Here is a source code for the GATOR oscillator as it is described at <a href="http://forex-indicators.net/bill-williams/gator-oscillator" target="_blank">Gator Oscillator by Bill Williams | Forex Indicators Guide</a>.<br />
<br />
1) Create the file gator.lua<br />
2) Copy the code below into this file<br />
3) Save the file<br />
or<br />
1,2,3) Just right-click on <a href="http://www.gehtsoftusa.com/bin/indicators/gator.lua" target="_blank">this link</a> and choose &quot;Save As...&quot; from the menu.<br />
<br />
4) Go to &quot;Charts/Chart/Manage Custom Indicators&quot; menu of the Trading Station<br />
5) Click &quot;Load&quot;<br />
6) Choose the gator.lua file created at the previous steps<br />
<br />
<b>IMPORTANT NOTE</b> At the moment of indicator writing (Sep, 23 2009), the indicator core library has an error which prevents the gator indicator from working well. Please, download the fixed core <a href="http://www.gehtsoftusa.com/bin/indicators/indicore2.dll" target="_blank">here</a> and replace indicore2 file with this file in the &quot;&quot;C:\Program Files\Candleworks\FXTS2\&quot; and/or &quot;C:\Program Files\Candleworks\FXOrder2Go\&quot; folders, in case your version is earlier than Sep, 23 2009. <br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">-- initializes the indicator<br />
function Init()<br />
&nbsp; &nbsp; indicator:name(&quot;Gator&quot;);<br />
&nbsp; &nbsp; indicator:description(&quot;&quot;)<br />
&nbsp; &nbsp; indicator:requiredSource(core.Tick);<br />
&nbsp; &nbsp; indicator:type(core.Oscillator);<br />
<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;JawN&quot;, &quot;Number of periods for smoothing the alligator jaw&quot;, &quot;&quot;, 13, 2, 1000);<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;JawS&quot;, &quot;Number of periods for shifting the alligator jaw&quot;, &quot;&quot;, 8, 1, 100);<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;TeethN&quot;, &quot;Number of periods for smoothing the alligator teeth&quot;, &quot;&quot;, 8, 2, 1000);<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;TeethS&quot;, &quot;Number of periods for shifting the alligator teeth&quot;, &quot;&quot;, 5, 1, 100);<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;LipsN&quot;, &quot;Number of periods for smoothing the alligator lips&quot;, &quot;&quot;, 5, 2, 1000);<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;LipsS&quot;, &quot;Number of periods for shifting the alligator lips&quot;, &quot;&quot;, 3, 1, 100);<br />
&nbsp; &nbsp; indicator.parameters:addString(&quot;MTH&quot;, &quot;Alligator Smoothing method&quot;, &quot;&quot;, &quot;MVA&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addStringAlternative(&quot;MTH&quot;, &quot;MVA&quot;, &quot;&quot;, &quot;MVA&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addStringAlternative(&quot;MTH&quot;, &quot;EMA&quot;, &quot;&quot;, &quot;EMA&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addStringAlternative(&quot;MTH&quot;, &quot;LWMA&quot;, &quot;&quot;, &quot;LWMA&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;CL_color&quot;, &quot;Color for covering line&quot;, &quot;Color for covering line&quot;, core.rgb(255, 255, 255));<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;GO_color&quot;, &quot;Color for higher bars&quot;, &quot;Color for higher bars&quot;, core.rgb(0, 255, 0));<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;RO_color&quot;, &quot;Color for lower bars&quot;, &quot;Color for lower bars&quot;, core.rgb(255, 0, 0));<br />
<br />
end<br />
<br />
-- lines parameters<br />
local JawN, JawS;<br />
local TeethN, TeethS;<br />
local LipsN, LipsC;<br />
<br />
-- indicator source<br />
local source;<br />
<br />
-- alligator lines<br />
local Jaw, Teeth, Lips;<br />
-- alligator lines sources<br />
local JawSrc, TeethSrc, LipsSrc;<br />
-- gator bars<br />
local Up, Down, UpRed, UpGreen, DownRed, DownGreen;<br />
-- bar's parameters<br />
local UpExtent, DownExtent;<br />
local UpFirst, DownFirst;<br />
<br />
-- process parameters and prepare for calculations<br />
function Prepare()<br />
&nbsp; &nbsp; JawN = instance.parameters.JawN;<br />
&nbsp; &nbsp; JawS = instance.parameters.JawS;<br />
&nbsp; &nbsp; TeethN = instance.parameters.TeethN;<br />
&nbsp; &nbsp; TeethS = instance.parameters.TeethS;<br />
&nbsp; &nbsp; LipsN = instance.parameters.LipsN;<br />
&nbsp; &nbsp; LipsS = instance.parameters.LipsS;<br />
<br />
&nbsp; &nbsp; source = instance.source;<br />
<br />
&nbsp; &nbsp; JawSrc = core.indicators:create(instance.parameters.MTH, source, JawN, core.rgb(0, 0, 0));<br />
&nbsp; &nbsp; TeethSrc = core.indicators:create(instance.parameters.MTH, source, TeethN, core.rgb(0, 0, 0));<br />
&nbsp; &nbsp; LipsSrc = core.indicators:create(instance.parameters.MTH, source, LipsN, core.rgb(0, 0, 0));<br />
<br />
&nbsp; &nbsp; local name = profile:id() .. &quot;(&quot; .. source:name() .. &quot;, &quot; .. JawN .. &quot;(&quot; .. JawS .. &quot;),&quot; .. TeethN .. &quot;(&quot; .. TeethS .. &quot;),&quot; .. LipsN .. &quot;(&quot; .. LipsS .. &quot;))&quot;;<br />
&nbsp; &nbsp; instance:name(name);<br />
<br />
<br />
&nbsp; &nbsp; Jaw = instance:addInternalStream(JawSrc.DATA:first() + JawS, JawS);<br />
&nbsp; &nbsp; Teeth = instance:addInternalStream(TeethSrc.DATA:first() + TeethS, TeethS);<br />
&nbsp; &nbsp; Lips = instance:addInternalStream(LipsSrc.DATA:first() + LipsS, LipsS);<br />
<br />
&nbsp; &nbsp; UpExtent = math.min(JawS, TeethS);<br />
&nbsp; &nbsp; UpFirst = math.max(Jaw:first(), Teeth:first());<br />
&nbsp; &nbsp; Up = instance:addStream(&quot;UP&quot;, core.Line, name .. &quot;.UP&quot;, &quot;UP&quot;, instance.parameters.CL_color, UpFirst, UpExtent);<br />
&nbsp; &nbsp; Up:addLevel(0);<br />
&nbsp; &nbsp; UpRed = instance:addStream(&quot;UPR&quot;, core.Bar, name .. &quot;.UPR&quot;, &quot;UPR&quot;, instance.parameters.RO_color, UpFirst, UpExtent);<br />
&nbsp; &nbsp; UpGreen = instance:addStream(&quot;UPG&quot;, core.Bar, name .. &quot;.UPG&quot;, &quot;UPG&quot;, instance.parameters.GO_color, UpFirst, UpExtent);<br />
<br />
&nbsp; &nbsp; DownExtent = math.min(TeethS, LipsS);<br />
&nbsp; &nbsp; DownFirst = math.max(Teeth:first(), Lips:first());<br />
&nbsp; &nbsp; Down = instance:addStream(&quot;DOWN&quot;, core.Line, name .. &quot;.DN&quot;, &quot;DN&quot;, instance.parameters.CL_color, DownFirst, DownExtent);<br />
&nbsp; &nbsp; DownRed = instance:addStream(&quot;DNR&quot;, core.Bar, name .. &quot;.DNR&quot;, &quot;DNR&quot;, instance.parameters.RO_color, DownFirst, DownExtent);<br />
&nbsp; &nbsp; DownGreen = instance:addStream(&quot;DNG&quot;, core.Bar, name .. &quot;.DNG&quot;, &quot;DNG&quot;, instance.parameters.GO_color, DownFirst, DownExtent);<br />
<br />
<br />
end<br />
<br />
-- Indicator calculation routine<br />
function Update(period, mode)<br />
&nbsp; &nbsp; -- calculate alligator<br />
&nbsp; &nbsp; JawSrc:update(mode);<br />
&nbsp; &nbsp; TeethSrc:update(mode);<br />
&nbsp; &nbsp; LipsSrc:update(mode);<br />
<br />
&nbsp; &nbsp; if (period + JawS &gt;= 0 and period &gt;= JawSrc.DATA:first()) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; Jaw[period + JawS] = JawSrc.DATA[period];<br />
&nbsp; &nbsp; end<br />
<br />
&nbsp; &nbsp; if (period + TeethS &gt;= 0 and period &gt;= TeethSrc.DATA:first()) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; Teeth[period + TeethS] = TeethSrc.DATA[period];<br />
&nbsp; &nbsp; end<br />
<br />
&nbsp; &nbsp; if (period + LipsS &gt;= 0 and period &gt;= LipsSrc.DATA:first()) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; Lips[period + LipsS] = LipsSrc.DATA[period];<br />
&nbsp; &nbsp; end<br />
&nbsp; &nbsp; -- calculate gator<br />
&nbsp; &nbsp; if period &gt;= UpFirst then<br />
&nbsp; &nbsp; &nbsp; &nbsp; Up[period + UpExtent] = math.abs(Jaw[period + UpExtent] - Teeth[period + UpExtent]);<br />
&nbsp; &nbsp; &nbsp; &nbsp; if period &gt;= UpFirst + 1 then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if Up[period + UpExtent] &gt;= Up[period + UpExtent - 1] then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UpGreen[period + UpExtent] = Up[period + UpExtent];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UpRed[period + UpExtent] = Up[period + UpExtent];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; end<br />
&nbsp; &nbsp; if period &gt;= DownFirst then<br />
&nbsp; &nbsp; &nbsp; &nbsp; Down[period + DownExtent] = -math.abs(Teeth[period + DownExtent] - Lips[period + DownExtent]);<br />
&nbsp; &nbsp; &nbsp; &nbsp; if period &gt;= DownFirst + 1 then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if Down[period + DownExtent] &gt;= Down[period + DownExtent - 1] then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DownGreen[period + DownExtent] = Down[period + DownExtent];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DownRed[period + DownExtent] = Down[period + DownExtent];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; end<br />
end</code><hr />
</div></div>


	<br />
	<div style="padding:6px">

	

	
		<fieldset class="fieldset">
			<legend>Attached Images</legend>
			<div style="padding:3px">
			<img class="attach" src="http://forexforums.dailyfx.com/attachments/indicator-sdk-support/37688d1253742942-example-gator-gator.png" border="0" alt="" />&nbsp;
			</div>
		</fieldset>
	

	

	

	</div>
]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>Nikolay.Gekht</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/105241-example-gator.html</guid>
		</item>
		<item>
			<title>Example: Acceleration/Deceleration</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/105005-example-acceleration-deceleration.html</link>
			<pubDate>Tue, 22 Sep 2009 22:08:07 GMT</pubDate>
			<description>Here is an examples of Acceleration/Deceleration...</description>
			<content:encoded><![CDATA[<div>Here is an examples of Acceleration/Deceleration oscillator as it is described at <a href="http://ta.mql4.com/indicators/bills/acceleration_deceleration" target="_blank">Accelerator/Decelerator Oscillator - Bill Williams - Technical Indicators - Technical Analysis</a><br />
<br />
How to install:<br />
<br />
1) Create the file AC.lua<br />
2) Copy the code below into this file<br />
3) Save the file<br />
or<br />
1,2,3) Just right-click on <a href="http://www.gehtsoftusa.com/bin/indicators/AC.lua" target="_blank">this link</a> and choose &quot;Save As...&quot; from the menu.<br />
<br />
4) Go to &quot;Charts/Chart/Manage Custom Indicators&quot; menu of the Trading Station<br />
5) Click &quot;Load&quot;<br />
6) Choose the AC.lua file create at the previous steps<br />
<br />
Please note that Awesome Oscillator indicator must be also installed (<a href="http://forexforums.dailyfx.com/indicator-sdk-support/104995-example-awesome-oscillator.html" target="_blank">http://forexforums.dailyfx.com/indic...scillator.html</a>) and named AO.lua<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">function Init()<br />
&nbsp; &nbsp; indicator:name(&quot;Acceleration/Deceleration&quot;);<br />
&nbsp; &nbsp; indicator:description(&quot;No description&quot;);<br />
&nbsp; &nbsp; indicator:requiredSource(core.Bar);<br />
&nbsp; &nbsp; indicator:type(core.Oscillator);<br />
<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;FM&quot;, &quot;Fast Moving Average for Awesome oscillator&quot;, &quot;The number of periods to calculate the fast moving average of the median price&quot;, 5, 2, 10000);<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;SM&quot;, &quot;Slow Moving Average for Awesome oscillator&quot;, &quot;The number of periods to calculate the slow moving average of the median price&quot;, 35, 2, 10000);<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;M&quot;, &quot;Moving Average for Acceleration/Deceleration&quot;, &quot;The number of periods to calculate the moving average of the AO&quot;, 5, 2, 10000);<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;CL_color&quot;, &quot;Color for covering line&quot;, &quot;Color for covering line&quot;, core.rgb(255, 255, 255));<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;GO_color&quot;, &quot;Color for higher bars&quot;, &quot;Color for higher bars&quot;, core.rgb(0, 255, 0));<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;RO_color&quot;, &quot;Color for lower bars&quot;, &quot;Color for lower bars&quot;, core.rgb(255, 0, 0));<br />
end<br />
<br />
local FM;<br />
local SM;<br />
local M;<br />
<br />
local first;<br />
local source = nil;<br />
<br />
-- Streams block<br />
local CL = nil;<br />
local GO = nil;<br />
local RO = nil;<br />
<br />
local AO = nil;<br />
local MVA = nil;<br />
<br />
function Prepare()<br />
&nbsp; &nbsp; FM = instance.parameters.FM;<br />
&nbsp; &nbsp; SM = instance.parameters.SM;<br />
&nbsp; &nbsp; M = instance.parameters.M;<br />
<br />
&nbsp; &nbsp; source = instance.source;<br />
<br />
&nbsp; &nbsp; AO = core.indicators:create(&quot;AO&quot;, source, FM, SM);<br />
&nbsp; &nbsp; MVA = core.indicators:create(&quot;MVA&quot;, AO.DATA, M);<br />
&nbsp; &nbsp; first = MVA.DATA:first();<br />
<br />
&nbsp; &nbsp; local name = profile:id() .. &quot;(&quot; .. source:name() .. &quot;, &quot; .. FM .. &quot;, &quot; .. SM .. &quot;, &quot; .. M .. &quot;)&quot;;<br />
&nbsp; &nbsp; instance:name(name);<br />
&nbsp; &nbsp; CL = instance:addStream(&quot;AC&quot;, core.Line, name .. &quot;.AC&quot;, &quot;AC&quot;, instance.parameters.CL_color, first);<br />
&nbsp; &nbsp; CL:addLevel(0);<br />
&nbsp; &nbsp; GO = instance:addStream(&quot;GO&quot;, core.Bar, name .. &quot;.GO&quot;, &quot;GO&quot;, instance.parameters.GO_color, first);<br />
&nbsp; &nbsp; RO = instance:addStream(&quot;RO&quot;, core.Bar, name .. &quot;.RO&quot;, &quot;RO&quot;, instance.parameters.RO_color, first);<br />
end<br />
<br />
function Update(period, mode)<br />
&nbsp; &nbsp; AO:update(mode);<br />
&nbsp; &nbsp; MVA:update(mode);<br />
<br />
&nbsp; &nbsp; if (period &gt;= first) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; CL[period] = AO.DATA[period] - MVA.DATA[period];<br />
&nbsp; &nbsp; end<br />
&nbsp; &nbsp; if (period &gt;= first + 1) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (CL[period] &gt; CL[period - 1]) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GO[period] = CL[period];<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RO[period] = CL[period];<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; end<br />
end</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>Nikolay.Gekht</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/105005-example-acceleration-deceleration.html</guid>
		</item>
		<item>
			<title>Example: Awesome Oscillator</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/104995-example-awesome-oscillator.html</link>
			<pubDate>Tue, 22 Sep 2009 21:54:39 GMT</pubDate>
			<description>Here is an example of the Awesome Oscillator as...</description>
			<content:encoded><![CDATA[<div>Here is an example of the Awesome Oscillator as it is described at <a href="http://www.metaquotes.net/techanalysis/indicators/awesome_oscillator" target="_blank">Awesome Oscillator &#8212; Technical Indicators, Technical Analysis</a><br />
<br />
<br />
How to install:<br />
<br />
1) Create the file AO.lua<br />
2) Copy the code below into this file<br />
3) Save the file<br />
or<br />
1,2,3) Just right-click on <a href="http://www.gehtsoftusa.com/bin/indicators/AO.lua" target="_blank">this link</a> and choose &quot;Save As...&quot; from the menu.<br />
<br />
4) Go to &quot;Charts/Chart/Manage Custom Indicators&quot; menu of the Trading Station<br />
5) Click &quot;Load&quot;<br />
6) Choose the AO.lua file create at the previous steps<br />
<br />
or<br />
<br />
<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">function Init()<br />
&nbsp; &nbsp; indicator:name(&quot;Awesome Oscillator&quot;);<br />
&nbsp; &nbsp; indicator:description(&quot;No description&quot;);<br />
&nbsp; &nbsp; indicator:requiredSource(core.Bar);<br />
&nbsp; &nbsp; indicator:type(core.Oscillator);<br />
<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;FM&quot;, &quot;Fast Moving Average&quot;, &quot;The number of periods to calculate the fast moving average of the median price&quot;, 5, 2, 10000);<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;SM&quot;, &quot;Slow Moving Average&quot;, &quot;The number of periods to calculate the slow moving average of the median price&quot;, 35, 2, 10000);<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;CL_color&quot;, &quot;Color for covering line&quot;, &quot;Color for covering line&quot;, core.rgb(255, 255, 255));<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;GO_color&quot;, &quot;Color for higher bars&quot;, &quot;Color for higher bars&quot;, core.rgb(0, 255, 0));<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;RO_color&quot;, &quot;Color for lower bars&quot;, &quot;Color for lower bars&quot;, core.rgb(255, 0, 0));<br />
end<br />
<br />
local FM;<br />
local SM;<br />
<br />
local first;<br />
local source = nil;<br />
<br />
-- Streams block<br />
local CL = nil;<br />
local GO = nil;<br />
local RO = nil;<br />
<br />
local MEDIAN = nil;<br />
local FMVA = nil;<br />
local SMVA = nil;<br />
<br />
function Prepare()<br />
&nbsp; &nbsp; FM = instance.parameters.FM;<br />
&nbsp; &nbsp; SM = instance.parameters.SM;<br />
<br />
&nbsp; &nbsp; assert(FM &lt; SM, &quot;Fast moving average parameter must be less than slow moving average&quot;);<br />
<br />
&nbsp; &nbsp; source = instance.source;<br />
&nbsp; &nbsp; first = source:first() + SM;<br />
<br />
&nbsp; &nbsp; -- Create the median stream<br />
&nbsp; &nbsp; MEDIAN = instance:addInternalStream(0, 0);<br />
&nbsp; &nbsp; FMVA = core.indicators:create(&quot;MVA&quot;, MEDIAN, FM);<br />
&nbsp; &nbsp; SMVA = core.indicators:create(&quot;MVA&quot;, MEDIAN, SM);<br />
<br />
&nbsp; &nbsp; local name = profile:id() .. &quot;(&quot; .. source:name() .. &quot;, &quot; .. FM .. &quot;, &quot; .. SM .. &quot;)&quot;;<br />
&nbsp; &nbsp; instance:name(name);<br />
&nbsp; &nbsp; CL = instance:addStream(&quot;AO&quot;, core.Line, name .. &quot;.AO&quot;, &quot;AO&quot;, instance.parameters.CL_color, first);<br />
&nbsp; &nbsp; CL:addLevel(0);<br />
&nbsp; &nbsp; GO = instance:addStream(&quot;GO&quot;, core.Bar, name .. &quot;.GO&quot;, &quot;GO&quot;, instance.parameters.GO_color, first);<br />
&nbsp; &nbsp; RO = instance:addStream(&quot;RO&quot;, core.Bar, name .. &quot;.RO&quot;, &quot;RO&quot;, instance.parameters.RO_color, first);<br />
end<br />
<br />
function Update(period, mode)<br />
&nbsp; &nbsp; MEDIAN[period] = (source.high[period] + source.low[period]) / 2;<br />
&nbsp; &nbsp; FMVA:update(mode);<br />
&nbsp; &nbsp; SMVA:update(mode);<br />
<br />
&nbsp; &nbsp; if (period &gt;= first) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; CL[period] = FMVA.DATA[period] - SMVA.DATA[period];<br />
&nbsp; &nbsp; end<br />
&nbsp; &nbsp; if (period &gt;= first + 1) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (CL[period] &gt; CL[period - 1]) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GO[period] = CL[period];<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RO[period] = CL[period];<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; end<br />
end</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>Nikolay.Gekht</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/104995-example-awesome-oscillator.html</guid>
		</item>
		<item>
			<title>How to plot Heikin Ashi on MarketScope</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/97116-how-plot-heikin-ashi-marketscope.html</link>
			<pubDate>Sun, 23 Aug 2009 08:22:57 GMT</pubDate>
			<description>Hi, 
 
I am trying to find source code for...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I am trying to find source code for ploting Heikin Ashi on MarketScope, but i can't find any.<br />
<br />
It is possible to code this indicator on Market Scope?<br />
<br />
<br />
<br />
fxmoonglow.</div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>fxmoonglow</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/97116-how-plot-heikin-ashi-marketscope.html</guid>
		</item>
		<item>
			<title>Example: Donchian Channel Indicator</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/92325-example-donchian-channel-indicator.html</link>
			<pubDate>Mon, 03 Aug 2009 21:47:40 GMT</pubDate>
			<description>1) Create the file DNC.lua 
2) Copy the code...</description>
			<content:encoded><![CDATA[<div>1) Create the file DNC.lua<br />
2) Copy the code below into this file<br />
3) Save the file<br />
or<br />
1,2,3) Just right-click on <a href="http://www.gehtsoftusa.com/bin/indicators/DNC.lua" target="_blank">this link</a> and choose &quot;Save As...&quot; from the menu.<br />
<br />
4) Go to &quot;Charts/Chart/Manage Custom Indicators&quot; menu of the Trading Station<br />
5) Click &quot;Load&quot;<br />
6) Choose the DNC.lua file created at the previous steps<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">-- initializes the indicator<br />
function Init()<br />
&nbsp; &nbsp; indicator:name(&quot;Donchian Channel&quot;)<br />
&nbsp; &nbsp; indicator:description(&quot;The simple trend-following indicator. Shows highest high and lowest low for the specified number of periods.&quot;);<br />
&nbsp; &nbsp; indicator:requiredSource(core.Bar);<br />
&nbsp; &nbsp; indicator:type(core.Indicator);<br />
<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;N&quot;, &quot;Number of periods&quot;, &quot;&quot;, 20, 2, 10000);<br />
&nbsp; &nbsp; indicator.parameters:addString(&quot;AC&quot;, &quot;Analyze the current period&quot;, &quot;&quot;, &quot;yes&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addStringAlternative(&quot;AC&quot;, &quot;no&quot;, &quot;&quot;, &quot;no&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addStringAlternative(&quot;AC&quot;, &quot;yes&quot;, &quot;&quot;, &quot;yes&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;clrDU&quot;, &quot;Color of the Up line&quot;, &quot;&quot;, core.rgb(255, 255, 0));<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;clrDN&quot;, &quot;Color of the Down line&quot;, &quot;&quot;, core.rgb(255, 255, 0));<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;clrDM&quot;, &quot;Color of the middle line&quot;, &quot;&quot;, core.rgb(255, 255, 0));<br />
&nbsp; &nbsp; indicator.parameters:addString(&quot;SM&quot;, &quot;Show middle line&quot;, &quot;&quot;, &quot;no&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addStringAlternative(&quot;SM&quot;, &quot;no&quot;, &quot;&quot;, &quot;no&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addStringAlternative(&quot;SM&quot;, &quot;yes&quot;, &quot;&quot;, &quot;yes&quot;);<br />
<br />
end<br />
<br />
local first = 0;<br />
local n = 0;<br />
local ac = true;<br />
local sm = false;<br />
local source = nil;<br />
local dn = nil;<br />
local du = nil;<br />
local dm = nil;<br />
<br />
-- initializes the instance of the indicator<br />
function Prepare()<br />
&nbsp; &nbsp; source = instance.source;<br />
&nbsp; &nbsp; n = instance.parameters.N;<br />
&nbsp; &nbsp; ac = (instance.parameters.AC == &quot;yes&quot;);<br />
&nbsp; &nbsp; sm = (instance.parameters.SM == &quot;yes&quot;);<br />
<br />
&nbsp; &nbsp; first = n + source:first() - 1;<br />
&nbsp; &nbsp; if (not ac) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; first = first + 1;<br />
&nbsp; &nbsp; end<br />
&nbsp; &nbsp; local name = profile:id() .. &quot;(&quot; .. source:name() .. &quot;,&quot; .. n .. &quot;)&quot;;<br />
&nbsp; &nbsp; instance:name(name);<br />
&nbsp; &nbsp; dn = instance:addStream(&quot;DU&quot;, core.Line, name .. &quot;.DU&quot;, &quot;DU&quot;, instance.parameters.clrDU,&nbsp; first)<br />
&nbsp; &nbsp; du = instance:addStream(&quot;DN&quot;, core.Line, name .. &quot;.DN&quot;, &quot;DN&quot;, instance.parameters.clrDN,&nbsp; first)<br />
&nbsp; &nbsp; if (sm) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; dm = instance:addStream(&quot;DM&quot;, core.Line, name .. &quot;.DM&quot;, &quot;DM&quot;, instance.parameters.clrDM,&nbsp; first)<br />
&nbsp; &nbsp; end<br />
end<br />
<br />
-- calculate the value<br />
function Update(period)<br />
&nbsp; &nbsp; if (period &gt;= first) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; local range;<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (ac) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; range = core.rangeTo(period, n);<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; range = core.rangeTo(period - 1, n);<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; &nbsp; &nbsp; du[period] = core.max(source.high, range);<br />
&nbsp; &nbsp; &nbsp; &nbsp; dn[period] = core.min(source.low, range);<br />
&nbsp; &nbsp; &nbsp; &nbsp; if (sm) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dm[period] = (du[period] + dn[period]) / 2;<br />
&nbsp; &nbsp; &nbsp; &nbsp; end<br />
&nbsp; &nbsp; end<br />
end</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>Nikolay.Gekht</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/92325-example-donchian-channel-indicator.html</guid>
		</item>
		<item>
			<title>Multi datasource</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/90667-multi-datasource.html</link>
			<pubDate>Tue, 28 Jul 2009 14:02:25 GMT</pubDate>
			<description>Hi, I realised that I am able to get data from a...</description>
			<content:encoded><![CDATA[<div>Hi, I realised that I am able to get data from a single source such as EUR/USD.close. Is it possible to get data from multiple source?<br />
<br />
Thanks</div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>TryFX</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/90667-multi-datasource.html</guid>
		</item>
		<item>
			<title>Sample Input Stream Data File?</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/90026-sample-input-stream-data-file.html</link>
			<pubDate>Sat, 25 Jul 2009 00:14:55 GMT</pubDate>
			<description>Hello, 
 
I have read the documentation provided...</description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I have read the documentation provided with the indicator SDK...  It did not provide any specification on the input stream data file requirement for use in the debugger...  Can you provide format information on the file requirements or perhaps a test data file I can use?<br />
<br />
Thanks,<br />
<br />
Nate</div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>knn10</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/90026-sample-input-stream-data-file.html</guid>
		</item>
		<item>
			<title>Example: The Elder-Ray Indicator</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/87884-example-elder-ray-indicator.html</link>
			<pubDate>Wed, 15 Jul 2009 23:39:08 GMT</pubDate>
			<description>Here is the source code of The Elder-Ray...</description>
			<content:encoded><![CDATA[<div>Here is the source code of The Elder-Ray Indicator as it is described at <a href="http://www.investopedia.com/articles/trading/03/022603.asp" target="_blank">Investopedia: The Elder-Ray Indicator: Seeing Into The Market </a><br />
<br />
1) Create the file elray.lua<br />
2) Copy the code below into this file<br />
3) Save the file<br />
or<br />
1,2,3) Just right-click on <a href="http://www.gehtsoftusa.com/bin/indicators/elray.lua" target="_blank">this link</a> and choose &quot;Save As...&quot; from the menu.<br />
<br />
4) Go to &quot;Charts/Chart/Manage Custom Indicators&quot; menu of the Trading Station<br />
5) Click &quot;Load&quot;<br />
6) Choose the elray.lua file created at the previous steps<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">-- Description from the http://www.investopedia.com/articles/trading/03/022603.asp<br />
<br />
-- initializes the indicator<br />
function Init()<br />
&nbsp; &nbsp; indicator:name(&quot;Elder-Ray&quot;);<br />
&nbsp; &nbsp; indicator:description(&quot;&quot;)<br />
&nbsp; &nbsp; indicator:requiredSource(core.Bar);<br />
&nbsp; &nbsp; indicator:type(core.Oscillator);<br />
<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;N&quot;, &quot;Number of periods for smoothing&quot;, &quot;&quot;, 13);<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;BullC&quot;, &quot;Color of the bull power line&quot;, &quot;&quot;, core.rgb(255, 0, 0));<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;BearC&quot;, &quot;Color of the bear power line&quot;, &quot;&quot;, core.rgb(0, 255, 0));<br />
end<br />
<br />
local source;<br />
local EMA;<br />
local Bull;<br />
local Bear;<br />
<br />
-- process parameters and prepare for calculations<br />
function Prepare()<br />
&nbsp; &nbsp; source = instance.source;<br />
&nbsp; &nbsp; EMA = core.indicators:create(&quot;EMA&quot;, source.close, instance.parameters.N, core.rgb(0, 0, 0));<br />
&nbsp; &nbsp; local name = profile:id() .. &quot;(&quot; .. source:name() .. &quot;, &quot; .. instance.parameters.N .. &quot;)&quot;;<br />
&nbsp; &nbsp; instance:name(name);<br />
&nbsp; &nbsp; Bull = instance:addStream(&quot;Bull&quot;, core.Line, name .. &quot;.Bull&quot;, &quot;Bull&quot;, instance.parameters.BullC, EMA.DATA:first());<br />
&nbsp; &nbsp; Bear = instance:addStream(&quot;Bear&quot;, core.Line, name .. &quot;.Bear&quot;, &quot;Bear&quot;, instance.parameters.BearC, EMA.DATA:first());<br />
&nbsp; &nbsp; Bull:addLevel(0);<br />
end<br />
<br />
-- Indicator calculation routine<br />
function Update(period, mode)<br />
&nbsp; &nbsp; EMA:update(mode);<br />
<br />
&nbsp; &nbsp; if (period &gt;= EMA.DATA:first()) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; Bull[period] = source.high[period] - EMA.DATA[period];<br />
&nbsp; &nbsp; &nbsp; &nbsp; Bear[period] = source.low[period] - EMA.DATA[period];<br />
&nbsp; &nbsp; end<br />
end</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>Nikolay.Gekht</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/87884-example-elder-ray-indicator.html</guid>
		</item>
		<item>
			<title>Example: Alligator indicator</title>
			<link>http://forexforums.dailyfx.com/indicator-sdk-support/87881-example-alligator-indicator.html</link>
			<pubDate>Wed, 15 Jul 2009 23:03:44 GMT</pubDate>
			<description>Here is a source code for the Alligator indicator...</description>
			<content:encoded><![CDATA[<div>Here is a source code for the Alligator indicator as it is described at <a href="http://www.metaquotes.net/techanalysis/indicators/alligator" target="_blank">Alligator and Gator Oscillator &#8212; Technical Indicators, Technical Analysis</a>.<br />
<br />
1) Create the file alligator.lua<br />
2) Copy the code below into this file<br />
3) Save the file<br />
or<br />
1,2,3) Just right-click on <a href="http://www.gehtsoftusa.com/bin/indicators/alligator.lua" target="_blank">this link</a> and choose &quot;Save As...&quot; from the menu.<br />
<br />
4) Go to &quot;Charts/Chart/Manage Custom Indicators&quot; menu of the Trading Station<br />
5) Click &quot;Load&quot;<br />
6) Choose the alligator.lua file created at the previous steps<br />
<br />
<br />
<div style="margin:20px; margin-top:5px">
	<div class="smallfont" style="margin-bottom:2px">Code:</div>
	<hr /><code style="margin:0px" dir="ltr" style="text-align:left">-- Description from the http://www.metaquotes.net/techanalysis/indicators/alligator<br />
<br />
-- initializes the indicator<br />
function Init()<br />
&nbsp; &nbsp; indicator:name(&quot;Alligator&quot;);<br />
&nbsp; &nbsp; indicator:description(&quot;&quot;)<br />
&nbsp; &nbsp; indicator:requiredSource(core.Tick);<br />
&nbsp; &nbsp; indicator:type(core.Indicator);<br />
<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;JawN&quot;, &quot;Number of periods for smoothing the alligator jaw&quot;, &quot;&quot;, 13);<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;JawS&quot;, &quot;Number of periods for shifting the alligator jaw&quot;, &quot;&quot;, 8);<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;JawC&quot;, &quot;Color of the the alligator jaw&quot;, &quot;&quot;, core.rgb(0, 0, 255));<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;TeethN&quot;, &quot;Number of periods for smoothing the alligator teeth&quot;, &quot;&quot;, 8);<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;TeethS&quot;, &quot;Number of periods for shifting the alligator teeth&quot;, &quot;&quot;, 5);<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;TeethC&quot;, &quot;Color of the the alligator teeth&quot;, &quot;&quot;, core.rgb(255, 0, 0));<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;LipsN&quot;, &quot;Number of periods for smoothing the alligator lips&quot;, &quot;&quot;, 5);<br />
&nbsp; &nbsp; indicator.parameters:addInteger(&quot;LipsS&quot;, &quot;Number of periods for shifting the alligator lips&quot;, &quot;&quot;, 3);<br />
&nbsp; &nbsp; indicator.parameters:addColor(&quot;LipsC&quot;, &quot;Color of the the alligator lips&quot;, &quot;&quot;, core.rgb(0, 255, 0));<br />
&nbsp; &nbsp; indicator.parameters:addString(&quot;MTH&quot;, &quot;Smoothing method&quot;, &quot;&quot;, &quot;MVA&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addStringAlternative(&quot;MTH&quot;, &quot;MVA&quot;, &quot;&quot;, &quot;MVA&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addStringAlternative(&quot;MTH&quot;, &quot;EMA&quot;, &quot;&quot;, &quot;EMA&quot;);<br />
&nbsp; &nbsp; indicator.parameters:addStringAlternative(&quot;MTH&quot;, &quot;LWMA&quot;, &quot;&quot;, &quot;LWMA&quot;);<br />
end<br />
<br />
-- lines parameters<br />
local JawN, JawS;<br />
local TeethN, TeethS;<br />
local LipsN, LipsC;<br />
<br />
-- indicator source<br />
local source;<br />
<br />
-- lines<br />
local Jaw, Teeth, Lips;<br />
-- lines sources<br />
local JawSrc, TeethSrc, LipsSrc;<br />
<br />
-- process parameters and prepare for calculations<br />
function Prepare()<br />
&nbsp; &nbsp; JawN = instance.parameters.JawN;<br />
&nbsp; &nbsp; JawS = instance.parameters.JawS;<br />
&nbsp; &nbsp; TeethN = instance.parameters.TeethN;<br />
&nbsp; &nbsp; TeethS = instance.parameters.TeethS;<br />
&nbsp; &nbsp; LipsN = instance.parameters.LipsN;<br />
&nbsp; &nbsp; LipsS = instance.parameters.LipsS;<br />
<br />
&nbsp; &nbsp; source = instance.source;<br />
<br />
&nbsp; &nbsp; JawSrc = core.indicators:create(instance.parameters.MTH, source, JawN, core.rgb(0, 0, 0));<br />
&nbsp; &nbsp; TeethSrc = core.indicators:create(instance.parameters.MTH, source, TeethN, core.rgb(0, 0, 0));<br />
&nbsp; &nbsp; LipsSrc = core.indicators:create(instance.parameters.MTH, source, LipsN, core.rgb(0, 0, 0));<br />
<br />
&nbsp; &nbsp; local name = profile:id() .. &quot;(&quot; .. source:name() .. &quot;, &quot; .. JawN .. &quot;(&quot; .. JawS .. &quot;),&quot; .. TeethN .. &quot;(&quot; .. TeethS .. &quot;),&quot; .. LipsN .. &quot;(&quot; .. LipsS .. &quot;))&quot;;<br />
&nbsp; &nbsp; instance:name(name);<br />
&nbsp; &nbsp; Jaw = instance:addStream(&quot;Jaw&quot;, core.Line, name .. &quot;.Jaw&quot;, &quot;Jaw&quot;, instance.parameters.JawC, JawSrc.DATA:first() + JawS, JawS);<br />
&nbsp; &nbsp; Teeth = instance:addStream(&quot;Teeth&quot;, core.Line, name .. &quot;.Teeth&quot;, &quot;Teeth&quot;, instance.parameters.TeethC, TeethSrc.DATA:first() + TeethS, TeethS);<br />
&nbsp; &nbsp; Lips = instance:addStream(&quot;Lips&quot;, core.Line, name .. &quot;.Lips&quot;, &quot;Lips&quot;, instance.parameters.LipsC, LipsSrc.DATA:first() + LipsS, LipsS);<br />
end<br />
<br />
-- Indicator calculation routine<br />
function Update(period, mode)<br />
&nbsp; &nbsp; JawSrc:update(mode);<br />
&nbsp; &nbsp; TeethSrc:update(mode);<br />
&nbsp; &nbsp; LipsSrc:update(mode);<br />
<br />
&nbsp; &nbsp; if (period + JawS &gt;= 0 and period &gt;= JawSrc.DATA:first()) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; Jaw[period + JawS] = JawSrc.DATA[period];<br />
&nbsp; &nbsp; end<br />
<br />
&nbsp; &nbsp; if (period + TeethS &gt;= 0 and period &gt;= TeethSrc.DATA:first()) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; Teeth[period + TeethS] = TeethSrc.DATA[period];<br />
&nbsp; &nbsp; end<br />
<br />
&nbsp; &nbsp; if (period + LipsS &gt;= 0 and period &gt;= LipsSrc.DATA:first()) then<br />
&nbsp; &nbsp; &nbsp; &nbsp; Lips[period + LipsS] = LipsSrc.DATA[period];<br />
&nbsp; &nbsp; end<br />
end</code><hr />
</div></div>

]]></content:encoded>
			<category domain="http://forexforums.dailyfx.com/indicator-sdk-support/">Indicator SDK Support</category>
			<dc:creator>Nikolay.Gekht</dc:creator>
			<guid isPermaLink="true">http://forexforums.dailyfx.com/indicator-sdk-support/87881-example-alligator-indicator.html</guid>
		</item>
	</channel>
</rss>
