Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator does not compile forward referenced components #62

Open
dondopong opened this issue Mar 1, 2023 · 2 comments
Open

Generator does not compile forward referenced components #62

dondopong opened this issue Mar 1, 2023 · 2 comments

Comments

@dondopong
Copy link

dondopong commented Mar 1, 2023

When there's a component inside another one, and the referenced component is declared after the main component in the xml, the generator does not compile it properly. Example:

    <component name="BaseTradingRules">
      <component name="TickRules" required="N" />
      <component name="LotTypeRules" required="N" />
      <component name="PriceLimits" required="N" />
      <field name="ExpirationCycle" required="N" />
      <field name="MinTradeVol" required="N" />
      <field name="MaxTradeVol" required="N" />
      <field name="MaxPriceVariation" required="N" />
      <field name="ImpliedMarketIndicator" required="N" />
      <field name="TradingCurrency" required="N" />
      <field name="RoundLot" required="N" />
      <field name="MultilegModel" required="N" />
      <field name="MultilegPriceMethod" required="N" />
      <field name="PriceType" required="N" />
    </component>

    <component name="TickRules">
      <group name="NoTickRules" required="N">
        <field name="StartTickPriceRange" required="N" />
        <field name="EndTickPriceRange" required="N" />
        <field name="TickIncrement" required="N" />
        <field name="TickRuleType" required="N" />
      </group>
    </component>

The output looks like this:

export interface IBaseTradingRules {
  ExpirationCycle?: number// [1] 827 (Int)
  MinTradeVol?: number// [2] 562 (Float)
  MaxTradeVol?: number// [3] 1140 (Float)
  MaxPriceVariation?: number// [4] 1143 (Float)
  ImpliedMarketIndicator?: number// [5] 1144 (Int)
  TradingCurrency?: string// [6] 1245 (String)
  RoundLot?: number// [7] 561 (Float)
  MultilegModel?: number// [8] 1377 (Int)
  MultilegPriceMethod?: number// [9] 1378 (Int)
  PriceType?: number// [10] 423 (Int)
}

Workaround for this: place the referenced component before the main component in the xml file.

@TimelordUK
Copy link
Owner

this has finally been fixed on the fix52 branch where your original file is now parsing with forward references

hope to merge and release soon.

export interface IBaseTradingRules {
  TickRules?: ITickRules// [1] NoTickRules.1205, StartTickPriceRange.1206 .. TickRuleType.1209
  LotTypeRules?: ILotTypeRules// [2] NoLotTypeRules.1234, LotType.1093 .. MaxLotSize.5515
  PriceLimits?: IPriceLimits// [3] PriceLimitType.1306, LowLimitPrice.1148 .. TradingReferencePrice.1150
  ExpirationCycle?: number// [4] 827 (Int)
  MinTradeVol?: number// [5] 562 (Float)
  MaxTradeVol?: number// [6] 1140 (Float)
  MaxPriceVariation?: number// [7] 1143 (Float)
  ImpliedMarketIndicator?: number// [8] 1144 (Int)
  TradingCurrency?: string// [9] 1245 (String)
  RoundLot?: number// [10] 561 (Float)
  MultilegModel?: number// [11] 1377 (Int)
  MultilegPriceMethod?: number// [12] 1378 (Int)
  PriceType?: number// [13] 423 (Int)
}

@dondopong
Copy link
Author

dondopong commented Nov 3, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants