<?xml version="1.0" encoding="utf-8"?>

<Strategy xmlns="http://www.fixprotocol.org/FIXatdl-1-1/Core"
    xmlns:val="http://www.fixprotocol.org/FIXatdl-1-1/Validation"
    xmlns:lay="http://www.fixprotocol.org/FIXatdl-1-1/Layout"
    xmlns:flow="http://www.fixprotocol.org/FIXatdl-1-1/Flow"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.fixprotocol.org/FIXatdl-1-1/Core tt-fixatdl-core-1-1.xsd"
    name="TT_Time_Duration" uiRep="TT Time Duration" version="15.116.16" providerID="TT" entryFile="algo.so">

    <HideFromUIComponents>
        <UIComponent>Dashboard</UIComponent>
    </HideFromUIComponents>

    <Parameter name="__instr_id"
               xsi:type="String_t"
               refValue="OrderInstrumentID"
               required="true" dir="In" updateable="false"/>

    <Parameter name="__order_quantity"
               xsi:type="Qty_t"
               refValue="OrderQty"
               required="true" dir="In" updateable="true"/>

    <Parameter name="__price"
               xsi:type="Price_t"
               refValue="OrderPrice"
               required="true" dir="In" updateable="true"/>

    <Parameter name="__side"
               xsi:type="Int_t"
               refValue="OrderSide"
               required="true" dir="In" updateable="false"/>

    <Parameter name="__account"
               xsi:type="String_t"
               refValue="OrderAccount"
               required="true" dir="In" updateable="false"/>

    <Parameter name="ChildTIF"
               xsi:type="Int_t"
               refValue="OrderTif"
               required="true" dir="In" updateable="false" orderEntryFixtag="16903"/>

    <Parameter name="ParentTIF" xsi:type="Int_t" initValue="eDay" required="true" dir="In" updateable="false" orderEntryFixtag="16950">
        <EnumPair enumID="eGTC" wireValue="2"/>
        <EnumPair enumID="eDay" wireValue="1"/>
        <EnumPair enumID="eTime" wireValue="7"/>
    </Parameter>

    <Parameter name="AutoResubExpiredGTD" xsi:type="Boolean_t" initValue="false"  required="false" dir="In" updateable="false" orderEntryFixtag="16949"/>

  <Parameter name="ETAGoToMktTicksEnabled" xsi:type="Boolean_t" required="false" dir="In" updateable="true" initValue="false"/>
  <Parameter name="ETAGoToMktTicks"
               xsi:type="Int_t"
               initValue="10" minValue="0" maxValue="100"
               required="false" dir="In" updateable="true" orderEntryFixtag="16960"/>

    <!-- Market or Limit -->
    <Parameter name="__type"
               xsi:type="Int_t"
               initValue="eLimit"
               required="true" dir="In" updateable="false">
        <EnumPair enumID="eMkt" wireValue="1"/>
        <EnumPair enumID="eLimit" wireValue="2"/>
    </Parameter>

    <!-- Time Slicing Details -->

    <!-- interval (on the wire always in ms) -->
    <Parameter name="Interval"
               xsi:type="Int_t"
               initValue="5" minValue="1"
               required="false" dir="In" updateable="false" orderEntryFixtag="16907"/>

    <!-- display qty -->
    <Parameter name="DiscVal"
               xsi:type="Qty_t"
               initValue="1" minValue="0.00000001"
               required="false" dir="In" updateable="true" orderEntryFixtag="16904"/>

    <Parameter name="DiscValType"
               xsi:type="Int_t"
               initValue="eQty"
               required="false" dir="In" updateable="false" orderEntryFixtag="16905">
        <EnumPair enumID="eQty" wireValue="1"/>
        <EnumPair enumID="ePercent" wireValue="2"/>
    </Parameter>

    <!-- duration -->
    <Parameter name="Duration"
               xsi:type="Int_t"
               initValue="1" minValue="1"
               required="false" dir="In"
               updateable="true"
               orderEntryFixtag="16944"/>

    <Parameter name="DurationBaseUnit"
               xsi:type="Int_t"
               initValue="eHour"
               required="false" dir="In"
               updateable="true"
               orderEntryFixtag="16945">
        <EnumPair enumID="eHour" wireValue="1"/>
        <EnumPair enumID="eMinute" wireValue="2"/>
        <EnumPair enumID="eSecond" wireValue="3"/>
    </Parameter>

    <Parameter name="DurationSTime"
               xsi:type="UTCTimestamp_t"
               required="false" dir="In"
               updateable="true"
               orderEntryFixtag="16946"/>

    <Parameter name="DurationETime"
               xsi:type="UTCTimestamp_t"
               required="false" dir="In"
               updateable="true"
               orderEntryFixtag="16947"/>

    <!-- Variance -->
    <Parameter name="Variance"
               xsi:type="Int_t"
               initValue="0" minValue="0" maxValue="100"
               required="false" dir="In" updateable="false" orderEntryFixtag="16958"/>

    <!-- Custom Slice Schedule -->
    <Parameter name="CustomSliceSched"
               xsi:type="String_t"
               initValue=""
               required="false" dir="In" updateable="true"/>

    <!-- Relative price -->
    <Parameter name="LimitTicksAway"
               xsi:type="Int_t"
               initValue="1" minValue="-999" maxValue="999"
               required="false" dir="In" updateable="true" orderEntryFixtag="16912"/>

    <Parameter name="LimitPriceType"
               xsi:type="Int_t"
               initValue="eLtp"
               required="false" dir="In" updateable="false" orderEntryFixtag="16911">
        <EnumPair enumID="eLtp" wireValue="3"/>
        <EnumPair enumID="eBid" wireValue="1"/>
        <EnumPair enumID="eAsk" wireValue="2"/>
        <EnumPair enumID="eSameSide" wireValue="6"/>
        <EnumPair enumID="eOppositeSide" wireValue="7"/>
    </Parameter>

    <!-- leftover -->
    <Parameter name="LeftoverAction"
               xsi:type="Int_t"
               required="true" dir="In" updateable="true" orderEntryFixtag="16909">
        <EnumPair enumID="eLeave" wireValue="0"/>
        <EnumPair enumID="ePayup" wireValue="1"/>
        <EnumPair enumID="eMerge" wireValue="2"/>
        <EnumPair enumID="eGoToMarket" wireValue="3"/>
    </Parameter>

    <Parameter name="LeftoverTicks"
               xsi:type="Int_t"
               initValue="1" minValue="-999" maxValue="999"
               required="false" dir="In" updateable="true" orderEntryFixtag="16910"/>

    <Parameter name="LeftoverTime" xsi:type="Int_t" required="false" dir="In" updateable="false" orderEntryFixtag="16971">
        <EnumPair enumID="eAtEnd" wireValue="0"/>
        <EnumPair enumID="eAtHalfLife" wireValue="1"/>
    </Parameter>

    <!-- Leftover Market Order Limit -->
    <Parameter name="LeftoverMktOrderLimitEnabled" xsi:type="Boolean_t" required="false" dir="In" updateable="true" initValue="false"/>
    <Parameter name="LeftoverMktOrderLimitTicks" xsi:type="Int_t" minValue="-999" maxValue="999" initValue="10" required="false" dir="In" updateable="true" orderEntryFixtag="16966"/>

    <!-- Trigger -->
    <Parameter name="TriggerType"
               xsi:type="Int_t"
               initValue="eStop"
               required="false" dir="In" updateable="false" orderEntryFixtag="16920">
        <EnumPair enumID="eStop" wireValue="1"/>
        <EnumPair enumID="eIT" wireValue="2"/>
    </Parameter>

    <Parameter name="__trigger_price"
               xsi:type="Price_t"
               required="false" dir="In" updateable="true"/>

    <Parameter name="TriggerPriceType"
               xsi:type="Int_t"
               initValue="eLtp"
               required="false" dir="In" updateable="false" orderEntryFixtag="16918">
        <EnumPair enumID="eLtp" wireValue="3"/>
        <EnumPair enumID="eBid" wireValue="1"/>
        <EnumPair enumID="eAsk" wireValue="2"/>
        <EnumPair enumID="eSameSide" wireValue="6"/>
        <EnumPair enumID="eOppositeSide" wireValue="7"/>
    </Parameter>

    <Parameter name="IsTrlTrg"
               xsi:type="Boolean_t"
               initValue="false"
               required="false" dir="In" updateable="false" orderEntryFixtag="16908"/>

    <Parameter name="TriggerTicksAway"
               xsi:type="Int_t"
               initValue="3" minValue="1" maxValue="99"
               required="false" dir="In" updateable="true" orderEntryFixtag="16919"/>

    <!-- With a Tick -->
    <Parameter name="WithATickType"
               xsi:type="Int_t"
               initValue="eQty"
               required="false" dir="In" updateable="false" orderEntryFixtag="16921">
        <EnumPair enumID="eQty" wireValue="1"/>
        <EnumPair enumID="ePercent" wireValue="2"/>
    </Parameter>

    <Parameter name="WithATick"
               xsi:type="Qty_t"
               initValue="1" minValue="0.00000001"
               required="false" dir="In" updateable="true" orderEntryFixtag="16922"/>

    <!-- Date and Time -->
    <Parameter name="STime"
               xsi:type="UTCTimestamp_t"
               required="false" dir="In" updateable="true" orderEntryFixtag="168"/>

    <Parameter name="ETime"
               xsi:type="UTCTimestamp_t"
               required="false" dir="In" updateable="true" orderEntryFixtag="126"/>

    <Parameter name="ETimeAct"
               xsi:type="Int_t"
               required="false" dir="In" updateable="false" orderEntryFixtag="16906">
        <EnumPair enumID="eCancel" wireValue="1"/>
        <EnumPair enumID="eETAGoToMkt" wireValue="2"/>
    </Parameter>
    <Parameter name="WaitingOption" xsi:type="Int_t" initValue="eNow" required="true" dir="In" updateable="false" orderEntryFixtag="16961">
        <EnumPair enumID="eNow"        wireValue="0"/>
        <EnumPair enumID="eTime"       wireValue="1"/>
        <EnumPair enumID="ePreOpen" wireValue="2"/>
        <EnumPair enumID="eOpen"      wireValue="3"/>
    </Parameter>
    <lay:StrategyLayout>
        <!-- Time duration details -->
        <lay:StrategyPanel class="main-panel">
            <lay:Control ID="TimeDuration_lbl" xsi:type="lay:Label_t" label="Slice details" class="atdl-panel-title"/>

            <!-- Slice Type (Interval/Disclose) -->
            <lay:StrategyPanel orientation="HORIZONTAL">
                <lay:Control ID="SliceType_lbl"
                             xsi:type="lay:Label_t"
                             label="Slice Type"/>

                <lay:Control ID="SliceType_ctrl"
                             xsi:type="lay:DropDownList_t"
                             initValue="eInterval">
                    <lay:ListItem enumID="eInterval" uiRep="Interval"/>
                    <lay:ListItem enumID="eDisclose" uiRep="Disclose"/>
                </lay:Control>
            </lay:StrategyPanel>

            <!-- Interval -->
            <lay:Control ID="Interval_ctrl" parameterRef="Interval"
                         xsi:type="lay:TTInterval_t"
                         initValue="5" initValueType="minute"
                         label="Interval">
                <flow:StateRule visible="true">
                    <val:Edit field="SliceType_ctrl" operator="EQ" value="eInterval"/>
                </flow:StateRule>
            </lay:Control>

            <!-- Disclosed qty -->
            <lay:StrategyPanel name="DisclosePanel" orientation="HORIZONTAL">
                <flow:StateRule visible="true">
                    <val:Edit field="SliceType_ctrl" operator="EQ" value="eDisclose"/>
                </flow:StateRule>

                <lay:Control ID="DiscVal_ctrl" parameterRef="DiscVal"
                             xsi:type="lay:SingleSpinner_t"
                             initValue="1"
                             label="Disclose"/>

                <lay:Control ID="DiscValType_ctrl" parameterRef="DiscValType"
                             xsi:type="lay:DropDownList_t"
                             initValue="eQty">
                    <lay:ListItem enumID="eQty" uiRep="Qty"/>
                    <lay:ListItem enumID="ePercent" uiRep="%"/>
                </lay:Control>
            </lay:StrategyPanel>
            <!-- Duration Type (Duration/StartEnd) -->
            <lay:StrategyPanel>
                <lay:StrategyPanel orientation="HORIZONTAL">
                    <lay:Control ID="DurationType_lbl"
                                 xsi:type="lay:Label_t"
                                 label="Duration Type"/>

                    <lay:Control ID="DurationType_ctrl"
                                 xsi:type="lay:DropDownList_t"
                                 initValue="eDuration">
                        <lay:ListItem enumID="eDuration" uiRep="Duration"/>
                        <lay:ListItem enumID="eStartEnd" uiRep="StartEnd"/>
                    </lay:Control>
                </lay:StrategyPanel>

                <!-- Duration -->
                <lay:StrategyPanel name="DurationPanel">
                    <flow:StateRule visible="true">
                        <val:Edit field="DurationType_ctrl" operator="EQ" value="eDuration"/>
                    </flow:StateRule>

                    <lay:StrategyPanel orientation="HORIZONTAL">
                        <lay:Control ID="Duration_ctrl" parameterRef="Duration"
                                     xsi:type="lay:SingleSpinner_t"
                                     initValue="1"
                                     label="Duration"/>

                        <lay:Control ID="DurationBaseUnit_ctrl" parameterRef="DurationBaseUnit"
                                     xsi:type="lay:DropDownList_t"
                                     initValue="eHour">
                            <lay:ListItem enumID="eHour" uiRep="hr"/>
                            <lay:ListItem enumID="eMinute" uiRep="min"/>
                            <lay:ListItem enumID="eSecond" uiRep="sec"/>
                        </lay:Control>
                    </lay:StrategyPanel>
                </lay:StrategyPanel>

                <!-- StartEnd Duration -->
                <lay:StrategyPanel name="DurationStartEndPanel">
                    <flow:StateRule visible="true">
                        <val:Edit field="DurationType_ctrl" operator="EQ" value="eStartEnd"/>
                    </flow:StateRule>

                    <lay:StrategyPanel orientation="HORIZONTAL">
                        <lay:Control ID="DurationStartTime_lbl"
                                     xsi:type="lay:Label_t"
                                     label="Start"/>

                        <lay:StrategyPanel name="HiddenDurationStartTimePanel">
                            <flow:StateRule visible="false">
                                <val:Edit logicOperator="AND"/>
                            </flow:StateRule>
                            <lay:Control ID="HiddenDurationStartTime_ctrl"
                                         xsi:type="lay:HiddenField_t"/>
                        </lay:StrategyPanel>

                        <lay:Control ID="DurationStartType_ctrl"
                                     xsi:type="lay:DropDownList_t"
                                     initValue="eNow">
                            <lay:ListItem enumID="eNow" uiRep="Now"/>
                            <lay:ListItem enumID="eTime" uiRep="Time"/>
                        </lay:Control>

                        <lay:Control ID="DurationStartTime_ctrl" parameterRef="DurationSTime"
                                     xsi:type="lay:Clock_t"
                                     initValueMode="1">
                            <flow:StateRule visible="true">
                                <val:Edit field="DurationStartType_ctrl" operator="EQ" value="eTime"/>
                            </flow:StateRule>
                        </lay:Control>
                    </lay:StrategyPanel>

                    <lay:StrategyPanel orientation="HORIZONTAL">
                        <lay:Control ID="DurationEndTime_lbl"
                                     xsi:type="lay:Label_t"
                                     label="End"/>

                        <lay:Control ID="DurationEndTime_ctrl" parameterRef="DurationETime"
                                     xsi:type="lay:Clock_t"
                                     initValueMode="1"/>
                    </lay:StrategyPanel>
                </lay:StrategyPanel>
            </lay:StrategyPanel>
            <!-- Variance & Custom Slice Schedule-->
            <lay:StrategyPanel orientation="HORIZONTAL">
                <lay:Control ID="Variance_lbl"
                             xsi:type="lay:Label_t"
                             label="Variance%"/>

                <lay:Control ID="Variance_ctrl" parameterRef="Variance"
                             xsi:type="lay:SingleSpinner_t"
                             initValue="0"/>

                <lay:Control ID="CustomSliceSched_ctrl" parameterRef="CustomSliceSched"
                             xsi:type="lay:PreviewPaneBtn_t"
                             initiValue=""/>
            </lay:StrategyPanel>
        </lay:StrategyPanel>

        <lay:StrategyPanel orientation="VERTICAL">
            <lay:Control ID="ChildOrderDetails_lbl" xsi:type="lay:Label_t" label="Child order details" class="atdl-panel-title"/>
            <!-- Order Type -->
            <lay:StrategyPanel orientation="HORIZONTAL">
                <lay:Control ID="ChildOrderType_lbl"
                             xsi:type="lay:Label_t"
                             label="Order Type"/>

                <lay:Control ID="ChildOrderType_ctrl" parameterRef="__type"
                             xsi:type="lay:DropDownList_t">
                    <lay:ListItem enumID="eLimit" uiRep="Limit"/>
                    <lay:ListItem enumID="eMkt" uiRep="Market"/>
                </lay:Control>
            </lay:StrategyPanel>

            <lay:StrategyPanel name="LimitModifierPanel">
                <flow:StateRule visible="true">
                    <val:Edit field="ChildOrderType_ctrl" operator="EQ" value="eLimit"/>
                </flow:StateRule>

                <!-- Relative price -->
                <lay:StrategyPanel name="OffsetPanel" orientation="HORIZONTAL">
                    <lay:Control ID="HasOffset_ctrl"
                                 xsi:type="lay:CheckBox_t"
                                 initValue="false"
                                 label="Offset"/>

                    <lay:Control ID="LimitTicksAway_ctrl" parameterRef="LimitTicksAway"
                                 xsi:type="lay:SingleSpinner_t">
                        <flow:StateRule visible="true">
                            <val:Edit field="HasOffset_ctrl" operator="EQ" value="true"/>
                        </flow:StateRule>
                    </lay:Control>

                    <lay:Control ID="LimitPriceType_ctrl" parameterRef="LimitPriceType"
                                 xsi:type="lay:DropDownList_t">
                        <flow:StateRule visible="true">
                            <val:Edit field="HasOffset_ctrl" operator="EQ" value="true"/>
                        </flow:StateRule>
                        <lay:ListItem enumID="eLtp" uiRep="LTP"/>
                        <lay:ListItem enumID="eBid" uiRep="Bid"/>
                        <lay:ListItem enumID="eAsk" uiRep="Ask"/>
                        <lay:ListItem enumID="eSameSide" uiRep="Same Side"/>
                        <lay:ListItem enumID="eOppositeSide" uiRep="Opposite Side"/>
                    </lay:Control>
                </lay:StrategyPanel>

                <!-- With a Tick -->
                <lay:StrategyPanel name="WithATickPanel" orientation="HORIZONTAL">
                    <lay:Control ID="HasWithATick_ctrl"
                                 xsi:type="lay:CheckBox_t"
                                 initValue="false"
                                 label="With a Tick"/>

                    <lay:Control ID="WithATick_ctrl" parameterRef="WithATick"
                                 xsi:type="lay:SingleSpinner_t">
                        <flow:StateRule visible="true">
                            <val:Edit field="HasWithATick_ctrl" operator="EQ" value="true"/>
                        </flow:StateRule>
                    </lay:Control>

                    <lay:Control ID="WithATickType_ctrl" parameterRef="WithATickType"
                                 xsi:type="lay:DropDownList_t"
                                 initValue="eQty">
                        <flow:StateRule visible="true">
                            <val:Edit field="HasWithATick_ctrl" operator="EQ" value="true"/>
                        </flow:StateRule>
                        <lay:ListItem enumID="eQty" uiRep="Qty"/>
                        <lay:ListItem enumID="ePercent" uiRep="%"/>
                    </lay:Control>
                </lay:StrategyPanel>

            </lay:StrategyPanel>

            <!-- Leftover action -->
            <lay:StrategyPanel name="LeftoverActionPanel" orientation="HORIZONTAL">
                <lay:Control ID="LeftoverActionType_ctrl" parameterRef="LeftoverAction"
                             xsi:type="lay:DropDownList_t" label="Leftover Action">
                    <lay:ListItem enumID="eLeave" uiRep="Leave"/>
                    <lay:ListItem enumID="ePayup" uiRep="Payup"/>
                    <lay:ListItem enumID="eGoToMarket" uiRep="Go To Market"/>
                    <lay:ListItem enumID="eMerge" uiRep="Merge"/>
                </lay:Control>
                <lay:Control ID="LeftoverActionTime_ctrl" parameterRef="LeftoverTime"
                             xsi:type="lay:DropDownList_t">
                    <lay:ListItem enumID="eAtEnd" uiRep="At End"/>
                    <lay:ListItem enumID="eAtHalfLife" uiRep="At Half Life"/>
                    <flow:StateRule value="eAtEnd">
                        <val:Edit logicOperator="OR">
                            <val:Edit field="LeftoverActionType_ctrl" operator="EQ" value="eLeave"/>
                            <val:Edit field="LeftoverActionType_ctrl" operator="EQ" value="eMerge"/>
                        </val:Edit>
                    </flow:StateRule>
                    <flow:StateRule enabled="false">
                        <val:Edit logicOperator="OR">
                            <val:Edit field="LeftoverActionType_ctrl" operator="EQ" value="eLeave"/>
                            <val:Edit field="LeftoverActionType_ctrl" operator="EQ" value="eMerge"/>
                        </val:Edit>
                    </flow:StateRule>
                </lay:Control>
            </lay:StrategyPanel>

            <!-- Market Order Limit -->
            <lay:StrategyPanel name="LeftoverMktOrderLimitPanel" orientation="HORIZONTAL">
                <flow:StateRule visible="true">
                    <val:Edit field="LeftoverActionType_ctrl" operator="EQ" value="eGoToMarket"/>
                </flow:StateRule>
                <lay:Control ID="LeftoverMktOrderLimitEnabled_ctrl" parameterRef="LeftoverMktOrderLimitEnabled" xsi:type="lay:CheckBox_t"
                             label="Mkt Order Limit" initValue="false"/>
                <lay:Control ID="LeftoverMktOrderLimitTicks_ctl" parameterRef="LeftoverMktOrderLimitTicks" xsi:type="lay:SingleSpinner_t">
                    <flow:StateRule enabled="true">
                        <val:Edit field="LeftoverMktOrderLimitEnabled_ctrl" operator="EQ" value="true"/>
                    </flow:StateRule>
                </lay:Control>
                <lay:Control ID="LeftoverMktOrderLimitTicks_label" xsi:type="lay:Label_t" label="ticks"/>
            </lay:StrategyPanel>

            <!-- Payup -->
            <lay:Control ID="PayupTicks_ctrl" parameterRef="LeftoverTicks"
                xsi:type="lay:SingleSpinner_t" label="Payup Ticks">
                <flow:StateRule visible="true">
                    <val:Edit field="LeftoverActionType_ctrl" operator="EQ" value="ePayup"/>
                </flow:StateRule>
            </lay:Control>

            <lay:Control ID="AutoResub" parameterRef="AutoResubExpiredGTD"
                    xsi:type="lay:CheckBox_t"
                    label="Auto-Resubmit Upon GTD Expiry"
                    initValue="false" />

        </lay:StrategyPanel>

        <!-- Start and End Time -->
        <lay:StrategyPanel orientation="VERTICAL">
            <lay:Control ID="TimingDetails_lbl" xsi:type="lay:Label_t" label="Precondition details" class="atdl-panel-title"/>
            <!-- Trigger -->
            <lay:StrategyPanel>
                <lay:StrategyPanel orientation="HORIZONTAL">
                    <lay:Control ID="Trigger" label="Trigger" initValue="false"
                        xsi:type="lay:CheckBox_t"> </lay:Control>
                    <lay:Control ID="TriggerOrderType_ctrl" parameterRef="TriggerType"
                        xsi:type="lay:DropDownList_t">
                        <flow:StateRule visible="true">
                            <val:Edit field="Trigger" operator="EQ" value="true"/>
                        </flow:StateRule>
                        <lay:ListItem enumID="eStop" uiRep="Stop"/>
                        <lay:ListItem enumID="eIT" uiRep="If Touched"/>
                    </lay:Control>
                </lay:StrategyPanel>
                <lay:StrategyPanel name="TriggerPanel" indent="true">
                    <flow:StateRule visible="true">
                        <val:Edit field="Trigger" operator="EQ" value="true"/>
                    </flow:StateRule>
                    <!-- Trigger price -->
                    <lay:StrategyPanel name="TriggerPricePanel" orientation="HORIZONTAL">
                        <lay:Control ID="TriggerPriceLabel_ctrl" label="Trigger price"
                                     xsi:type="lay:Label_t"/>
                        <lay:Control ID="TriggerPrice_ctrl" parameterRef="__trigger_price"
                            xsi:type="lay:SingleSpinner_t">
                            <flow:StateRule visible="true">
                                <val:Edit field="TrailStopAllowed" operator="EQ" value="false"/>
                            </flow:StateRule>
                        </lay:Control>
                        <lay:Control ID="TriggerPriceType_ctrl" parameterRef="TriggerPriceType"
                            xsi:type="lay:DropDownList_t">
                            <lay:ListItem enumID="eLtp" uiRep="LTP"/>
                            <lay:ListItem enumID="eBid" uiRep="Bid"/>
                            <lay:ListItem enumID="eAsk" uiRep="Ask"/>
                            <lay:ListItem enumID="eSameSide" uiRep="Same Side"/>
                            <lay:ListItem enumID="eOppositeSide" uiRep="Opposite Side"/>
                        </lay:Control>
                    </lay:StrategyPanel>
                    <!-- Trailing -->
                    <lay:StrategyPanel name="TrailStopPanel" orientation="HORIZONTAL">
                        <lay:Control ID="TrailStopAllowed" parameterRef="IsTrlTrg" label="Trail (ticks)"
                                     xsi:type="lay:CheckBox_t"> </lay:Control>
                        <lay:Control ID="TrailStop_ctrl" parameterRef="TriggerTicksAway"
                                     xsi:type="lay:SingleSpinner_t">
                            <flow:StateRule visible="true">
                                <val:Edit field="TrailStopAllowed" operator="EQ" value="true"/>
                            </flow:StateRule>
                        </lay:Control>
                    </lay:StrategyPanel>
                </lay:StrategyPanel>
            </lay:StrategyPanel>
            <lay:StrategyPanel name="StartEndTimePanel">
                <lay:StrategyPanel name="StartTimePanel" orientation="HORIZONTAL">
                    <flow:StateRule visible="true">
                      <val:Edit field="DurationType_ctrl" operator="EQ" value="eDuration"/>
                    </flow:StateRule>
                    <lay:StrategyPanel indent="true">
                        <lay:Control ID="StartTime_lbl"
                                     xsi:type="lay:Label_t"
                                     label="Start">
                        </lay:Control>
                    </lay:StrategyPanel>
                    <lay:Control ID="StartType_ctrl"
                                 column="3"
                                 parameterRef="WaitingOption"
                                 xsi:type="lay:DropDownList_t"
                                 initValue="eNow">
                        <lay:ListItem enumID="eNow" uiRep="Now"/>
                        <lay:ListItem enumID="eTime" uiRep="Time"/>
                        <lay:ListItem enumID="ePreOpen" uiRep="Pre-Open"/>
                        <lay:ListItem enumID="eOpen" uiRep="Open"/>
                    </lay:Control>

                    <lay:Control ID="StartTime_ctrl" parameterRef="STime"
                                 xsi:type="lay:Clock_t"
                                 initValueMode="1">
                        <flow:StateRule visible="true">
                            <val:Edit field="StartType_ctrl" operator="EQ" value="eTime"/>
                        </flow:StateRule>
                    </lay:Control>
                </lay:StrategyPanel>

                <lay:StrategyPanel orientation="HORIZONTAL">
                    <lay:StrategyPanel indent="true">
                        <lay:Control ID="EndTime_lbl"
                                     xsi:type="lay:Label_t"
                                     label="End"/>
                    </lay:StrategyPanel>

                    <lay:Control ID="EndType_ctrl"
                                 column="3"
                                 xsi:type="lay:DropDownList_t"
                                 parameterRef="ParentTIF"
                                 initValue="eGTC">
                        <lay:ListItem enumID="eGTC" uiRep="GTC"/>
                        <lay:ListItem enumID="eTime" uiRep="Time"/>
                        <lay:ListItem enumID="eDay" uiRep="Day"/>
                    </lay:Control>

                    <lay:Control ID="EndTime_ctrl" parameterRef="ETime"
                                 xsi:type="lay:Clock_t"
                                 initValueMode="1">
                        <flow:StateRule visible="true">
                            <val:Edit field="EndType_ctrl" operator="EQ" value="eTime"/>
                        </flow:StateRule>
                    </lay:Control>
                </lay:StrategyPanel>

                <lay:StrategyPanel name="EndTimeActionPanel">
                    <!-- EndTimeActions -->
                    <lay:StrategyPanel orientation="HORIZONTAL" indent="true">
                        <lay:Control ID="EndTimeAction_ctrl" parameterRef="ETimeAct"
                                     xsi:type="lay:DropDownList_t"
                                     initValue="eCancel"
                                     label="At End Action">
                            <lay:ListItem enumID="eCancel" uiRep="Cancel"/>
                            <lay:ListItem enumID="eETAGoToMkt" uiRep="GoToMarket"/>
                            <flow:StateRule visible="true">
                                <val:Edit field="EndType_ctrl" operator="EQ" value="eTime"/>
                            </flow:StateRule>
                        </lay:Control>
                    </lay:StrategyPanel>

                    <!-- ETA GTM ticks -->
                    <lay:StrategyPanel name="ETAGTMPanel" orientation="HORIZONTAL" indent="true">
                        <flow:StateRule visible="true">
                            <val:Edit logicOperator="AND">
                                <val:Edit field="EndType_ctrl" operator="EQ" value="eTime"/>
                                <val:Edit field="EndTimeAction_ctrl" operator="EQ" value="eETAGoToMkt"/>
                            </val:Edit>
                        </flow:StateRule>
                      <lay:Control ID="etagtmTicksEnabled_ctrl" parameterRef="ETAGoToMktTicksEnabled" xsi:type="lay:CheckBox_t"
                                   label="Mkt Order Lmt" initValue="false"/>
                      <lay:Control ID="etagtmTicks_ctrl" parameterRef="ETAGoToMktTicks" xsi:type="lay:SingleSpinner_t">
                        <flow:StateRule enabled="true">
                          <val:Edit field="etagtmTicksEnabled_ctrl" operator="EQ" value="true"/>
                        </flow:StateRule>
                      </lay:Control>
                      <lay:Control ID="ETAGTMTicks_label" xsi:type="lay:Label_t" label="ticks"/>
                    </lay:StrategyPanel>
                </lay:StrategyPanel>
            </lay:StrategyPanel>
        </lay:StrategyPanel>
    </lay:StrategyLayout>

    <val:StrategyEdit errorMessage="Display quantity must be greater than 0">
        <val:Edit logicOperator="OR">
            <val:Edit logicOperator="AND">
                <val:Edit field="DiscValType" operator="EQ" value="1"/>
                <val:Edit field="DiscVal" operator="NE" value=""/>
                <val:Edit field="DiscVal" operator="GE" value="1"/>
            </val:Edit>
            <val:Edit field="DiscValType" operator="EQ" value=""/>
            <val:Edit field="DiscValType" operator="EQ" value="2"/>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Display percentage must be between 1 and 99">
        <val:Edit logicOperator="OR">
            <val:Edit logicOperator="AND">
                <val:Edit field="DiscValType" operator="EQ" value="2"/>
                <val:Edit field="DiscVal" operator="GE" value="1"/>
                <val:Edit field="DiscVal" operator="LE" value="99"/>
            </val:Edit>
            <val:Edit field="DiscValType" operator="EQ" value=""/>
            <val:Edit field="DiscValType" operator="EQ" value="1"/>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Duration (hour) must be between 1 and 99">
        <val:Edit logicOperator="OR">
            <val:Edit logicOperator="AND">
                <val:Edit field="DurationBaseUnit" operator="EQ" value="1"/>
                <val:Edit field="Duration" operator="GE" value="1"/>
                <val:Edit field="Duration" operator="LE" value="99"/>
            </val:Edit>
            <val:Edit field="DurationBaseUnit" operator="NE" value="1"/>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Duration (minute) must be between 1 and 9999">
        <val:Edit logicOperator="OR">
            <val:Edit logicOperator="AND">
                <val:Edit field="DurationBaseUnit" operator="EQ" value="2"/>
                <val:Edit field="Duration" operator="GE" value="1"/>
                <val:Edit field="Duration" operator="LE" value="9999"/>
            </val:Edit>
            <val:Edit field="DurationBaseUnit" operator="NE" value="2"/>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Duration (second) must be between 1 and 9999">
        <val:Edit logicOperator="OR">
            <val:Edit logicOperator="AND">
                <val:Edit field="DurationBaseUnit" operator="EQ" value="3"/>
                <val:Edit field="Duration" operator="GE" value="1"/>
                <val:Edit field="Duration" operator="LE" value="9999"/>
            </val:Edit>
            <val:Edit field="DurationBaseUnit" operator="NE" value="3"/>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Duration Start Time must precede Duration End Time.">
        <val:Edit logicOperator="OR">
            <val:Edit field="DurationSTime" operator="EQ" value=""/>
            <val:Edit field="DurationETime" operator="EQ" value=""/>
            <val:Edit field="DurationSTime" operator="LT" field2="DurationETime"/>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Precondition Start Time must equal or precede Duration Start Time.">
        <val:Edit logicOperator="OR">
            <val:Edit field="DurationSTime" operator="EQ" value=""/>
            <val:Edit field="STime" operator="EQ" value=""/>
            <val:Edit field="STime" operator="LE" field2="DurationSTime"/>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Variance percentage must be between 0 and 99">
        <val:Edit logicOperator="AND">
            <val:Edit field="Variance" operator="GE" value="0"/>
            <val:Edit field="Variance" operator="LE" value="99"/>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Limit Offset must be between -999 and 999">
        <val:Edit logicOperator="OR">
            <val:Edit logicOperator="AND">
                <val:Edit field="LimitPriceType" operator="NE" value=""/>
                <val:Edit field="LimitTicksAway" operator="NE" value=""/>
                <val:Edit field="LimitTicksAway" operator="LE" value="999"/>
                <val:Edit field="LimitTicksAway" operator="GE" value="-999"/>
            </val:Edit>
            <val:Edit logicOperator="AND">
                <val:Edit field="LimitPriceType" operator="EQ" value=""/>
                <val:Edit field="LimitTicksAway" operator="EQ" value=""/>
            </val:Edit>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Trigger Price must be set">
        <val:Edit logicOperator="OR">
            <val:Edit logicOperator="AND">
                <val:Edit field="TriggerPriceType" operator="NE" value=""/>
                <val:Edit field="TriggerType" operator="NE" value=""/>
                <val:Edit field="__trigger_price" operator="NE" value=""/>
            </val:Edit>
            <val:Edit logicOperator="AND">
                <val:Edit field="TriggerPriceType" operator="EQ" value=""/>
                <val:Edit field="TriggerType" operator="EQ" value=""/>
            </val:Edit>
            <val:Edit field="IsTrlTrg" operator="EQ" value="true"/>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Trail (ticks) must be between 1 and 500.">
        <val:Edit logicOperator="OR">
            <val:Edit logicOperator="AND">
                <val:Edit field="IsTrlTrg" operator="EQ" value="true"/>
                <val:Edit field="TriggerPriceType" operator="NE" value=""/>
                <val:Edit field="TriggerType" operator="NE" value=""/>
                <val:Edit field="TriggerTicksAway" operator="GE" value="1"/>
                <val:Edit field="TriggerTicksAway" operator="LE" value="500"/>
            </val:Edit>
            <val:Edit logicOperator="AND">
                <val:Edit field="IsTrlTrg" operator="EQ" value=""/>
                <val:Edit field="TriggerPriceType" operator="EQ" value=""/>
                <val:Edit field="TriggerType" operator="EQ" value=""/>
            </val:Edit>
            <val:Edit logicOperator="AND">
                <val:Edit field="IsTrlTrg" operator="EQ" value="false"/>
                <val:Edit field="TriggerPriceType" operator="NE" value=""/>
                <val:Edit field="TriggerType" operator="NE" value=""/>
            </val:Edit>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="With a Tick quantity must be greater than 0">
        <val:Edit logicOperator="OR">
            <val:Edit field="WithATickType" operator="NE" value="1"/>
            <val:Edit logicOperator="AND">
                <val:Edit field="WithATickType" operator="EQ" value="1"/>
                <val:Edit field="WithATick" operator="NE" value=""/>
                <val:Edit field="WithATick" operator="GE" value="1"/>
            </val:Edit>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="With a Tick percentage must be positive">
        <val:Edit logicOperator="OR">
            <val:Edit field="WithATickType" operator="NE" value="2"/>
            <val:Edit logicOperator="AND">
                <val:Edit field="WithATickType" operator="EQ" value="2"/>
                <val:Edit field="WithATick" operator="NE" value=""/>
                <val:Edit field="WithATick" operator="GE" value="1"/>
            </val:Edit>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Start Time must precede End Time.">
        <val:Edit logicOperator="OR">
            <val:Edit field="STime" operator="EQ" value=""/>
            <val:Edit field="ETime" operator="EQ" value=""/>
            <val:Edit field="STime" operator="LT" field2="ETime"/>
        </val:Edit>
    </val:StrategyEdit>

    <val:StrategyEdit errorMessage="Child time in force is not compatible with parent day order">
        <val:Edit logicOperator="OR">
            <val:Edit field="ParentTIF" operator="EQ" value="7"/>
            <val:Edit field="ParentTIF" operator="EQ" value="2"/>
            <val:Edit logicOperator="AND">
                <val:Edit field="ParentTIF" operator="EQ" value="1"/>
                <val:Edit logicOperator="OR">
                    <val:Edit field="ChildTIF" operator="EQ" value="1"/>
                    <val:Edit field="ChildTIF" operator="EQ" value="4"/>
                    <val:Edit field="ChildTIF" operator="EQ" value="5"/>
                </val:Edit>
            </val:Edit>
        </val:Edit>
    </val:StrategyEdit>
</Strategy>
