Hi All,
I am not sure what i want to do is possible or not, but we have a custom parameter IWouldSizeType which essentially lets the clients tell me if they want to use percentage (1-100%) or shares (unlimited)
The way i want it to work is if the client selects IWouldSizeType=[Percentage] then below show IWould% with a box to enter 1-100%
IWouldSizeType=[Shares] then below show IWouldSize with a box to enter any number i decide without a limit.
I currently have the following:
<lay:Control xsi:type=“lay:DropDownList_t” ID=“IWouldSizeType” parameterRef=“IWouldSizeType” label=“I Would Size Type”
tooltip=“Specify the reference type for I Would Size.”>
<lay:ListItem enumID=“NONE” uiRep="" />
<lay:ListItem enumID=“Shares” uiRep=“Shares” />
<lay:ListItem enumID=“Percent” uiRep=“Percent” />
</lay:Control>
Please let me know if this is not possible?
Hi Jack,
Not sure if you have found an answer to this but there are a couple of ways to achieve this and your chosen solution may depend on what values you support for the I Would % field downstream. If you support fractional values in the % field then it may be better to spearate them out.
If you only support integer values for the %, the solution below combines the IWould% and IWouldQty into 1 FIX tag, with the IWouldType as a qualifier (i.e. % or shares) and apply to the correct parameter in your logic engine downstream. You can use the StrategyEdit within the ATDL to validate the entries before sending over FIX.
<Strategy name="VWAP" wireValue="VWAP" providerID="Test" version="1.1" uiRep="VWAP" >
<Description>Test description</Description>
<SecurityTypes>
<SecurityType name="CS" inclusion="Include"/>
</SecurityTypes>
<Parameter name="IWouldPrice" xsi:type="Float_t" fixTag="25001" precision="4" minValue="0"/>
<Parameter name="IWouldSize" xsi:type="Int_t" fixTag="25002" minValue="0"/>
<Parameter name="IWouldType" xsi:type="Char_t" fixTag="25003" >
<EnumPair enumID="e_percent" wireValue="1"/>
<EnumPair enumID="e_shares" wireValue="2"/>
</Parameter>
<lay:StrategyLayout>
<lay:StrategyPanel title="I Would Parameters" collapsible="false" collapsed="false" orientation="VERTICAL" >
<lay:StrategyPanel collapsible="false" orientation="HORIZONTAL" >
<lay:Control ID="c_IWouldPrice" xsi:type="lay:SingleSpinner_t" label="I Would Price" parameterRef="IWouldPrice" increment="0.01"/>
<lay:Control ID="c_IWouldSize" xsi:type="lay:SingleSpinner_t" label="I Would Size" parameterRef="IWouldSize" increment="1"/>
<lay:Control ID="c_IWouldType" xsi:type="lay:DropDownList_t" label="I Would Type" parameterRef="IWouldType" initValue="e_percent" >
<lay:ListItem enumID="e_percent" uiRep="%"/>
<lay:ListItem enumID="e_shares" uiRep="Shares"/>
<flow:StateRule enabled="false" value="{NULL}" >
<val:Edit field="c_IWouldSize" operator="NX" />
</flow:StateRule>
</lay:Control>
</lay:StrategyPanel>
</lay:StrategyPanel>
</lay:StrategyLayout>
<val:StrategyEdit errorMessage="I Would Price must be greater than 0" >
<val:Edit logicOperator="OR" >
<val:Edit field="IWouldPrice" operator="NX"/>
<val:Edit field="IWouldPrice" operator="GT" value="0"/>
</val:Edit>
</val:StrategyEdit>
<val:StrategyEdit errorMessage="I Would Size must be in the range 1-100% or >0 shares" >
<val:Edit logicOperator="OR" >
<val:Edit field="IWouldType" operator="NX"/>
<val:Edit logicOperator="AND" >
<val:Edit field="IWouldType" operator="EQ" value="1" />
<val:Edit logicOperator="AND" >
<val:Edit field="IWouldSize" operator="GE" value="1"/>
<val:Edit field="IWouldSize" operator="LE" value="100"/>
</val:Edit>
</val:Edit>
<val:Edit logicOperator="AND" >
<val:Edit field="IWouldType" operator="EQ" value="2" />
<val:Edit field="IWouldSize" operator="GE" value="1"/>
</val:Edit>
</val:Edit>
</val:StrategyEdit>
</Strategy>
I would not recommend hiding/showing highly used fields such as IWould fields as users may find this confusing - not only will they be looking for the I Would Size field from the start but with many vendors the hidden field still occupies an absolute position. You can try changing the “visible” to “enabled” which will grey out the parameter rather than hiding it. In either case a solution is below:
<Strategy name="VWAP" wireValue="VWAP" providerID="Test" version="1.1" uiRep="VWAP" >
<Description>Test description</Description>
<SecurityTypes>
<SecurityType name="CS" inclusion="Include"/>
</SecurityTypes>
<Parameter name="IWouldPrice" xsi:type="Float_t" fixTag="25001" precision="4" minValue="0"/>
<Parameter name="IWouldPercent" xsi:type="Int_t" fixTag="25002" minValue="0"/>
<Parameter name="IWouldQty" xsi:type="Int_t" fixTag="25003" minValue="0"/>
<Parameter name="IWouldType" xsi:type="Char_t" fixTag="25004" >
<EnumPair enumID="e_null" wireValue=""/>
<EnumPair enumID="e_percent" wireValue="1"/>
<EnumPair enumID="e_shares" wireValue="2"/>
</Parameter>
<lay:StrategyLayout>
<lay:StrategyPanel title="I Would Parameters" collapsible="false" collapsed="false" orientation="VERTICAL" >
<lay:StrategyPanel collapsible="false" orientation="HORIZONTAL" >
<lay:Control ID="c_IWouldPrice" xsi:type="lay:SingleSpinner_t" label="I Would Price" parameterRef="IWouldPrice" increment="0.01"/>
<lay:Control ID="c_IWouldType" xsi:type="lay:DropDownList_t" label="I Would Type" parameterRef="IWouldType" initValue="e_null" >
<lay:ListItem enumID="e_null" uiRep=""/>
<lay:ListItem enumID="e_percent" uiRep="%"/>
<lay:ListItem enumID="e_shares" uiRep="Shares"/>
</lay:Control>
<lay:Control ID="c_IWouldPercent" xsi:type="lay:SingleSpinner_t" label="I Would Percent" parameterRef="IWouldPercent" increment="1">
<flow:StateRule visible="false" >
<val:Edit field="c_IWouldType" operator="NE" value="e_percent"/>
</flow:StateRule>
</lay:Control>
<lay:Control ID="c_IWouldQty" xsi:type="lay:SingleSpinner_t" label="I Would Qty" parameterRef="IWouldQty" increment="1">
<flow:StateRule visible="false" >
<val:Edit field="c_IWouldType" operator="NE" value="e_shares"/>
</flow:StateRule>
</lay:Control>
</lay:StrategyPanel>
</lay:StrategyPanel>
</lay:StrategyLayout>
<val:StrategyEdit errorMessage="I Would Price must be greater than 0" >
<val:Edit logicOperator="OR" >
<val:Edit field="IWouldPrice" operator="NX"/>
<val:Edit field="IWouldPrice" operator="GT" value="0"/>
</val:Edit>
</val:StrategyEdit>
<val:StrategyEdit errorMessage="I Would Size must be in the range 1-100% or >0 shares" >
<val:Edit logicOperator="OR" >
<val:Edit field="IWouldType" operator="NX"/>
<val:Edit logicOperator="AND" >
<val:Edit field="IWouldType" operator="EQ" value="1" />
<val:Edit logicOperator="AND" >
<val:Edit field="IWouldPercent" operator="GE" value="1"/>
<val:Edit field="IWouldPercent" operator="LE" value="100"/>
</val:Edit>
</val:Edit>
<val:Edit logicOperator="AND" >
<val:Edit field="IWouldType" operator="EQ" value="2" />
<val:Edit field="IWouldQty" operator="GE" value="1"/>
</val:Edit>
</val:Edit>
</val:StrategyEdit>
</Strategy>
Hope that helps