<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Balidev.com Software Development</title>
	<atom:link href="http://www.balidev.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.balidev.com</link>
	<description>Metatrader Expert Advisor Development Specialist</description>
	<pubDate>Tue, 08 Jan 2008 07:44:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>PriceChannel-LowHigh - a Low/High Price Channel Indicator</title>
		<link>http://www.balidev.com/archives/pricechannel-lowhigh-a-lowhigh-price-channel-indicator</link>
		<comments>http://www.balidev.com/archives/pricechannel-lowhigh-a-lowhigh-price-channel-indicator#comments</comments>
		<pubDate>Thu, 03 Jan 2008 06:51:00 +0000</pubDate>
		<dc:creator>yogi triana</dc:creator>
		
		<category><![CDATA[Indicator Module]]></category>

		<category><![CDATA[Metatrader Modules]]></category>

		<guid isPermaLink="false">http://www.balidev.com/archives/pricechannel-lowhigh-a-lowhigh-price-channel-indicator</guid>
		<description><![CDATA[The PriceChannel-LowHigh is a Low/High price channel indicator. This indicator simply showing the lowest or highest value for a certain last period.
This simple indicator, is known used by the famous Turtle Trading System.
This indicator freely available in PriceChannel-LowHigh.ex4 binary file and also the PriceChannel-LowHigh.mq4 source code file format.
]]></description>
			<content:encoded><![CDATA[<p>The PriceChannel-LowHigh is a Low/High price channel indicator. This indicator simply showing the lowest or highest value for a certain last period.</p>
<p>This simple indicator, is known used by the famous Turtle Trading System.</p>
<p>This indicator freely available in <a href="http://www.balidev.com/wp-content/uploads/2008/01/pricechannel-lowhigh.ex4" title="PriceChannel-LowHigh.ex4 binary file">PriceChannel-LowHigh.ex4 binary file</a> and also the <a href="http://www.balidev.com/wp-content/uploads/2008/01/pricechannel-lowhigh.mq4" title="PriceChannel-LowHigh.mq4 source code">PriceChannel-LowHigh.mq4 source code</a> file format.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.balidev.com/archives/pricechannel-lowhigh-a-lowhigh-price-channel-indicator/feed</wfw:commentRss>
		</item>
		<item>
		<title>Code Snipset to Filter Order Placement by Weekly Timeframe</title>
		<link>http://www.balidev.com/archives/code-snipset-to-filter-order-placement-by-weekly-timeframe</link>
		<comments>http://www.balidev.com/archives/code-snipset-to-filter-order-placement-by-weekly-timeframe#comments</comments>
		<pubDate>Tue, 01 Jan 2008 08:46:53 +0000</pubDate>
		<dc:creator>yogi triana</dc:creator>
		
		<category><![CDATA[Script Snipset]]></category>

		<guid isPermaLink="false">http://www.balidev.com/archives/code-snipset-to-filter-order-placement-by-weekly-timeframe</guid>
		<description><![CDATA[
Previously we write a simple code to filter order placement by daily timeframe. This version modify the previous code, to provide filtering facility base on weekly time frame.
With this simple script you will be able to filter base on weekly time frame such as preventing order placement in the week end or for others specific [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-right: 20px; float: left"><a href="http://www.balidev.com/wp-content/uploads/2007/11/mql4wizard.gif" title="mql4wizard.gif"><img src="http://www.balidev.com/wp-content/uploads/2007/11/mql4wizard.gif" alt="mql4wizard.gif" border="0" /></a></p>
<p>Previously we write a simple code to filter order placement by daily timeframe. This version modify the previous code, to provide filtering facility base on weekly time frame.</p>
<p>With this simple script you will be able to filter base on weekly time frame such as preventing order placement in the week end or for others specific purposes</p>
<p><span id="more-15"></span>Add following code on your EA:</p>
<pre>
extern bool    filter_time_enable  = true;
extern string  filter_time_range   = "sun 00:00 - sat 23:59;";

int atimestart[10];
int atimestop[10];
int timerangecount = 0;

int day_enum(string day) {
  if (day == "sun") { return(0); }
  else if (day == "mon") { return (1); }
  else if (day == "tue") { return (2); }
  else if (day == "wed") { return (3); }
  else if (day == "thu") { return (4); }
  else if (day == "fri") { return (5); }
  else if (day == "sat") { return (6); }
  else return (-1);
}

int second_in_week (string time) {
   string day = StringSubstr(time, 0, 3);
   string strtime = StringSubstr(time, 4, 0);
   int day_val = day_enum(day);
   if (day_val == -1) {
      return (-1);
   }
   int time_val =
       (StrToInteger(StringSubstr(strtime, 0,2)) * 60 * 60) +
       (StrToInteger(StringSubstr(strtime, 3,2)) * 60);

   if (time_val &lt; 0) {
      return (-1);
   }   

   return ((day_val * 24 * 60 * 60) + time_val);   

}

int init_time_filter() {
   /* on this initialization function we parse the parameters
      and make an array contains
      an array of allowed trading time */
   string strt = trim(filter_time_range);
   int start = 0;
   int len = StringLen(strt);
   string range_token;
   while (start &lt; len) {

      int tokensemicolon = StringFind(strt, ";", start);
      if (tokensemicolon == -1) {
        if (len - start &lt; 19) {
           MessageBox(
            "Parameter filter_time_range contains error!");
           break;
        }
        range_token = trim(StringSubstr(strt, start,0));
      } else {
        range_token = trim(StringSubstr(
                           strt, start, tokensemicolon));
      }

      int tokendash = StringFind(range_token, "-", 0);
      if ((tokendash == -1) || (tokendash &gt; tokensemicolon)) {
         MessageBox(
           "Parameter filter_time_range contains error!");
         break;
      }

      string timestart =
            trim(StringSubstr(range_token, 0, tokendash));
      string timestop  =
            trim(StringSubstr(range_token, tokendash + 1,0));
      if ((StringLen(timestart) &lt; 9 ) ||
            (StringLen(timestop) &lt; 9 )) {
        MessageBox(
            "Parameter prm_trade_timeframe contains error!");
        break;
      }

      int dd_start = second_in_week(timestart);
      int dd_stop = second_in_week(timestop);

      if ((dd_start &lt; 0) || (dd_stop &lt; 0) ||
          (dd_start &gt;= dd_stop)) {
        MessageBox(
            "Parameter filter_time_range contains error!");
        break;
      }

      atimestart[timerangecount] = dd_start;
      atimestop[timerangecount] = dd_stop;
      timerangecount++;
      start = tokensemicolon + 1; // process next time
   }
   return(0);
}

int deinit_time_filter() {
   return(0);
}

bool is_trading_time(datetime time){
  int theday = TimeDayOfWeek(time);
  int thetime =  (TimeHour(time) * 60 * 60) +
                 (TimeMinute(time) * 60 ) +
                 TimeSeconds(time);
  int trade_time = (theday * 24 * 60 * 60) + thetime;

  /* search if this time exists in the array */
  int idx;
  bool found = false;
  for (idx = 0; idx &lt; timerangecount; idx ++) {
     found = ((atimestart[idx] &lt;= trade_time) &amp;&amp;
              (atimestop[idx] &gt;= trade_time));
     if (found) {
        break;
     }
  }

  return(found);
}

int init() {

   if (filter_time_enable) {
      init_time_filter();
   }

   /* your code here ... */

   return(0);
}

int deinit() {
   if (filter_time_enable) {
      deinit_time_filter();
   }

   /* your code here ... */
   return(0);
}

int start() {

   /* your code goes here .... */

   /* when performing filter call like this .... */

   if ((filter_time_enable) &amp;&amp; (is_trading_time(Time[0])) {
      /* your code goes here .... */
   }

   /* your code goes here .... */

   return (0);
}</pre>
<p>Enjoy&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.balidev.com/archives/code-snipset-to-filter-order-placement-by-weekly-timeframe/feed</wfw:commentRss>
		</item>
		<item>
		<title>Code Snipset to Filter Order Placement Base on Time</title>
		<link>http://www.balidev.com/archives/code-snipset-to-filter-order-placement-base-on-time</link>
		<comments>http://www.balidev.com/archives/code-snipset-to-filter-order-placement-base-on-time#comments</comments>
		<pubDate>Thu, 15 Nov 2007 07:36:05 +0000</pubDate>
		<dc:creator>yogi triana</dc:creator>
		
		<category><![CDATA[Script Snipset]]></category>

		<guid isPermaLink="false">http://www.balidev.com/archives/code-snipset-to-filter-order-placement-base-on-time</guid>
		<description><![CDATA[
In many cases, we need to put order/transaction placement filter base on time. For example, we only want to entry the market during the busy hour, or only entry the market in a specific time, etc..
Following code is a simple and general purpose code for your expert advisor. The time filter can be configured through [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-right: 20px; float: left"><a href="http://www.balidev.com/wp-content/uploads/2007/11/mql4wizard.gif" title="mql4wizard.gif"><img src="http://www.balidev.com/wp-content/uploads/2007/11/mql4wizard.gif" alt="mql4wizard.gif" border="0" /></a></p>
<p>In many cases, we need to put order/transaction placement filter base on time. For example, we only want to entry the market during the busy hour, or only entry the market in a specific time, etc..</p>
<p>Following code is a simple and general purpose code for your expert advisor. The time filter can be configured through the EA parameters &#8220;prm_trade_timeframe&#8221;.</p>
<p><span id="more-11"></span></p>
<pre>extern bool   time_filter          = true;
extern string prm_trade_timeframe  = "00:00-06:00;17:00-23:58;";

string atimestart[10];
string atimestop[10];
int timerangecount = 0;

int init(){
   /* -------- insert this code int the EA initialization -----*/
   string strt = prm_trade_timeframe;
   int start = 0;
   int len = StringLen(strt);
   while (start &lt; len) {
      int tokensemicolon = StringFind(strt, ";", start);
      if (tokensemicolon == -1) {
        if (len - start &lt; 5) {
           break;
        }
      }
      int tokendash = StringFind(strt, "-", start);
      if ((tokendash == -1) || (tokendash &gt; tokensemicolon)) {
         break;
      }
      string timestart =
            StringSubstr(strt, start, tokendash - start);
      string timestop  =
            StringSubstr(strt, tokendash + 1,
            tokensemicolon - tokendash - 1);
      if ((StringLen(timestart) != 5 ) ||
            (StringLen(timestop) != 5 )) {
        MessageBox(
            "Parameter prm_trade_timeframe contains error!");
        break;
      }
      atimestart[timerangecount] = timestart;
      atimestop[timerangecount] = timestop;
      timerangecount++;
      start = tokensemicolon + 1; // process next time
   }
   if (timerangecount == 0) {
     MessageBox(
          "No time range specified, no trade seem to be allowed.");
   } else {
     int i;
     for (i = 0; i &lt; timerangecount; i++) {
       Print(StringConcatenate("Trade Allowed Time: ",
                  atimestart[i], " to ", atimestop[i]));
     }
   }
   /* -------------*/
   return(0);
}

bool is_trading_time(int time){
  bool allowed = false;
  int i;
  for (i = 0; i &lt; timerangecount; i++) {
    allowed = (time &gt;= StrToTime(atimestart[i])) &amp;&amp;
            ((time &lt;= StrToTime(atimestop[i])));
    if (allowed) {
      break;
    }
  }
  return (allowed);
}</pre>
<pre></pre>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.balidev.com/archives/code-snipset-to-filter-order-placement-base-on-time/feed</wfw:commentRss>
		</item>
		<item>
		<title>Developing An Automated Trading System</title>
		<link>http://www.balidev.com/archives/developing-an-automated-trading-system</link>
		<comments>http://www.balidev.com/archives/developing-an-automated-trading-system#comments</comments>
		<pubDate>Wed, 14 Nov 2007 10:48:07 +0000</pubDate>
		<dc:creator>yogi triana</dc:creator>
		
		<category><![CDATA[General Articles]]></category>

		<category><![CDATA[automated trading system]]></category>

		<guid isPermaLink="false">http://www.balidev.com/archives/developing-an-automated-trading-system</guid>
		<description><![CDATA[
Computer system has changed the human life. Many human aspects depend on this system. From simple cases such house ware like washing machine into the complicated medical equipment and space craft now computer controlled.
The financial service also use extensively this computer system. Marketing, trading and financial control now use computer system.
The forex trading as one [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-right: 20px; float: left"><a href="http://www.balidev.com/wp-content/uploads/2007/11/computer_usd.jpg" title="computer_usd.jpg"><img style="border:none;" src="http://www.balidev.com/wp-content/uploads/2007/11/computer_usd.jpg" alt="computer_usd.jpg" /></a></p>
<p>Computer system has changed the human life. Many human aspects depend on this system. From simple cases such house ware like washing machine into the complicated medical equipment and space craft now computer controlled.</p>
<p>The financial service also use extensively this computer system. Marketing, trading and financial control now use computer system.</p>
<p>The forex trading as one of the most liquid market also uses the computer system. Together with the internet technology, the forex trading take many advantages from this system such as:</p>
<ul>
<li>World wide market access</li>
<li>Almost instant and real time execution</li>
<li>Comprehensive analytical and trend calculation</li>
<li>Automated Trading strategy execution</li>
</ul>
<p><span id="more-8"></span><strong>Which Strategy Should be Automated?</strong></p>
<ul>
<li>Do you use a fully a technical analysis?</li>
<li>Do you use a well defined strategy, including :
<ul>
<li>entry condition,</li>
<li>exit condition either by stop loss, take profit or specific exit condition,</li>
<li>position sizing to calculate the gain you may achieved or any losses you may accept.</li>
</ul>
</li>
<li>Does your strategy executed in the short to the midterm time frame?&#8230; and &#8230;</li>
<li>Do you want to sit back, enjoy your life and make the system and money work for you?</li>
</ul>
<p>If you answer &#8220;Yes&#8221; to all those questions, you should consider to write your trading strategy into an automated system.</p>
<p><strong>Why Should I Make It Automated</strong></p>
<p>Many advantages can be achieved by using computer controlled automated trading system:</p>
<ul>
<li>The system will identify and react to the market movement faster. The system will calculate any market indicators you use as consideration to take position in the trading strategy and automatically take the trade position for you.</li>
<li>More market penetration simultaneously. Computer system have ability to calculate and monitor many data feed at a time. This mean <span class="sitetext">that you can include                            multiple conditional entries and exits, profit targets,                            protective stops, trailing stops, and more in your strategies,                          and have them all automated simultaneously.</span></li>
<li>Get rid of any human emotion  in the trading strategy and increase trading discipline.</li>
<li>Run the strategy 24 hours a day, 7 days a week, 365 days a year.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.balidev.com/archives/developing-an-automated-trading-system/feed</wfw:commentRss>
		</item>
		<item>
		<title>Balidev.com Specialized into Metatrader Expert Advisor Development</title>
		<link>http://www.balidev.com/archives/balidevcom-specialized-into-metatrader-expert-advisor-development</link>
		<comments>http://www.balidev.com/archives/balidevcom-specialized-into-metatrader-expert-advisor-development#comments</comments>
		<pubDate>Tue, 13 Nov 2007 05:03:34 +0000</pubDate>
		<dc:creator>yogi triana</dc:creator>
		
		<category><![CDATA[Expert Advisor]]></category>

		<category><![CDATA[General Articles]]></category>

		<category><![CDATA[Indicator Module]]></category>

		<category><![CDATA[Metatrader Modules]]></category>

		<category><![CDATA[Trading Algorithm]]></category>

		<category><![CDATA[Wordpress Themes and Plugins]]></category>

		<guid isPermaLink="false">http://www.balidev.com/?p=3</guid>
		<description><![CDATA[
As business goes into the market driven, the Balidev.com Software Development now specializing into specific development area.
Balidev.com commit to perform technical research to produce profitable trading strategy and write the automated trading system base on the produced strategy algorithm.
]]></description>
			<content:encoded><![CDATA[<p style="margin-right: 20px; float: left"><a href="http://www.balidev.com/wp-content/uploads/2007/11/mt4.gif" title="mt4.gif"><img src="http://www.balidev.com/wp-content/uploads/2007/11/mt4.gif" alt="mt4.gif" style="border: medium none " /></a></p>
<p>As business goes into the market driven, the Balidev.com Software Development now specializing into specific development area.</p>
<p>Balidev.com commit to perform technical research to produce profitable trading strategy and write the automated trading system base on the produced strategy algorithm.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.balidev.com/archives/balidevcom-specialized-into-metatrader-expert-advisor-development/feed</wfw:commentRss>
		</item>
	</channel>
</rss>

