<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Data-file parameter ignored]]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/9440/" />
	<updated>2023-05-11T14:53:05Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/9440/datafile-parameter-ignored/</id>
		<entry>
			<title type="html"><![CDATA[Re: Data-file parameter ignored]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/74783/#p74783" />
			<content type="html"><![CDATA[<p>I managed to run it only by making the commands a single-line string.</p><div class="codebox"><pre><code>$timeframes = &#039;M1&#039;, &#039;M5&#039;, &#039;M15&#039;

foreach ($timeframe in $timeframes) {

    $maxDataBars = switch ($timeframe) {
        &#039;M1&#039;  { 200000 }
        &#039;M5&#039;  {  55000 }
        &#039;M15&#039; {  35000 }
    }

    $datafile = &quot;.\data\Premium\EURUSD_${timeframe}.json&quot;

    $command  = &quot;node .\bin\gen.js --data-file $datafile --max-data-bars $maxDataBars&quot;

    start cmd -ArgumentList &quot;/k $command&quot;
}</code></pre></div><p><a href="https://image-holder.forexsb.com/store/xgen-powershell-script-test1.png"><span class="postimg"><img src="https://image-holder.forexsb.com/store/xgen-powershell-script-test1-thumb.png" alt="https://image-holder.forexsb.com/store/xgen-powershell-script-test1-thumb.png" /></span></a></p><br /><p>Note:</p><p>To make it possible to execute Powershell scripts run: <br /></p><div class="codebox"><pre><code>Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Popov]]></name>
				<uri>https://forexsb.com/forum/user/2/</uri>
			</author>
			<updated>2023-05-11T14:53:05Z</updated>
			<id>https://forexsb.com/forum/post/74783/#p74783</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Data-file parameter ignored]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/74761/#p74761" />
			<content type="html"><![CDATA[<p>I found the solution myself. By using the cmd prompt it&#039;s working also from PowerShell script. It doesn&#039;t matter if we use PowerShell or CMD for execution:<br /></p><div class="codebox"><pre><code>$timeframes = 1,5,15

foreach ($timeframe in $timeframes)
{
    
    $maxDataBars = switch ( $timeframe )
    {
        1  { 200000 }
        5  { 55000 }
        15 { 35000 }        
    }
    
    $datafile = &quot;.\mydata\${timeframe}.json&quot;        
    
    $command = &quot;node .\bin\gen.js `
               --settings .\forex.ini `
               --period = $timeframe `
               --data_file = $datafile `
               --max_data_bars = $maxDataBars&quot;

    start cmd -ArgumentList &quot;/k $command&quot;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[felix-brenkel]]></name>
				<uri>https://forexsb.com/forum/user/14530/</uri>
			</author>
			<updated>2023-05-10T10:27:38Z</updated>
			<id>https://forexsb.com/forum/post/74761/#p74761</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Data-file parameter ignored]]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/74757/#p74757" />
			<content type="html"><![CDATA[<p>I have the problem, that the data-file parameter is ignored when I use it as a parameter in my PowerShell script:</p><div class="codebox"><pre><code>$timeframe = 5
$datafile = &quot;c:\express-generator\mydata\$timeframe.json&quot;      

start powershell {node .\bin\gen.js `
                  --settings .\forex.ini `
                  --period = $timeframe `
                  --data-file = $datafile `
                  --max_data_bars = 200000 `                  
                  ;Read-Host}</code></pre></div><p>This is giving me this error message:</p><div class="codebox"><pre><code>..:: Express Generator v2.26 ::..
Cannot read data file: C:\express-generator\data\1.json</code></pre></div><p>The seems to be a default file which is used.</p>]]></content>
			<author>
				<name><![CDATA[felix-brenkel]]></name>
				<uri>https://forexsb.com/forum/user/14530/</uri>
			</author>
			<updated>2023-05-10T08:53:40Z</updated>
			<id>https://forexsb.com/forum/post/74757/#p74757</id>
		</entry>
</feed>
