<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2" -->
<rss version="2.0">
    <channel>
        <title>Lowyat.NET: Latest topics by ChrisJL</title>
        <description></description>
        <link>http://forum.lowyat.net/</link>
        <lastBuildDate>Sun, 21 Jun 2026 23:03:08 +0800</lastBuildDate>
        <generator>FeedCreator 1.7.2</generator>
        <item>
            <title>Constraining int type to constant name only</title>
            <link>http://forum.lowyat.net/topic/4118517</link>
            <description>In mql4, does anyone know how to restrict integer orderType to constant name only? I am using orderType to accept values from constants such as OP_BUY (equiv to 0), OP_SELL (equiv to 1), OP_BUYLIMIT, or OP_SELLLIMIT, etc.&lt;br /&gt;&lt;br /&gt;This is my structure,&lt;br /&gt;&lt;br /&gt;&lt;!--c1--&gt;&lt;div class='codetop'&gt;CODE&lt;/div&gt;&lt;div class='codemain'&gt;&lt;!--ec1--&gt;// Structure to store the order information -&amp;#62; ticket no, stop lost price etc.&lt;br /&gt;struct tradeStruct&lt;br /&gt;{&lt;br /&gt; &amp;nbsp; int ticket;&lt;br /&gt; &amp;nbsp; int orderType;&lt;br /&gt; &amp;nbsp; double orderOpenPrice;&lt;br /&gt; &amp;nbsp; double stopLostPrice;&lt;br /&gt; &amp;nbsp; double minClosePrice;&lt;br /&gt; &amp;nbsp; double activator;&lt;br /&gt;};&lt;br /&gt;tradeStruct trades&amp;#91;&amp;#93;;&lt;br /&gt;&lt;!--c2--&gt;&lt;/div&gt;&lt;!--ec2--&gt;&lt;br /&gt;&lt;br /&gt;And I want it like &lt;i&gt;trades[0].orderType = OP_BUY&lt;/i&gt; only (restricted), instead of allowing &lt;i&gt;trades[0].orderType = 0&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;I don&amp;#39;t think this is possible in mql4/mql5 unless I am using enum to replace the int type &lt;i&gt;orderType&lt;/i&gt;. But who knows maybe someone can show me some amazing techniques?  &lt;!--emo&amp;:hmm:--&gt;&lt;img src='http://static.lowyat.net/style_emoticons/default/hmm.gif' border='0' style='vertical-align:middle' alt='hmm.gif' /&gt;&lt;!--endemo--&gt;</description>
            <author>ChrisJL</author>
            <category>Codemasters</category>
            <pubDate>Sat, 19 Nov 2016 22:37:13 +0800</pubDate>
        </item>
        <item>
            <title>Undestanding DP solution for knapsack problem</title>
            <link>http://forum.lowyat.net/topic/3765924</link>
            <description>Help&amp;#33;&lt;br /&gt;&lt;br /&gt;Does anyone master at dynamic programming?&lt;br /&gt;&lt;br /&gt;can anyone describe in simplest terms why with dynamic programming we can get the result for the problem below??&lt;br /&gt;&lt;br /&gt;For example, suppose you are a thief and you invaded a house. Inside you found the following items:&lt;br /&gt;&lt;br /&gt;1. A vase that weights 3 pounds and is worth 50 dollars.&lt;br /&gt;2. A silver nugget that weights 6 pounds and is worth 30 dollars.&lt;br /&gt;3. A painting that weights 4 pounds and is worth 40 dollars.&lt;br /&gt;4. A mirror that weights 5 pounds and is worth 10 dollars.&lt;br /&gt;&lt;br /&gt;determine which items you should pick to maximize the value while keeping the overall weight smaller than the limit of your knapsack i.e. 10.&lt;br /&gt;&lt;br /&gt;Answer is 90. yes, but how the logic of top down dp works to achieve that?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;</description>
            <author>ChrisJL</author>
            <category>Codemasters</category>
            <pubDate>Thu, 05 Nov 2015 15:07:39 +0800</pubDate>
        </item>
    </channel>
</rss>
