Order of symbols is not preserved while fetching ltp

aryankejriwal4

Order of symbols is not preserved while fetching ltp, is this random order ?
  • SRIJAN
    SRIJAN edited August 2022
    No, it's not random. The items in your given iterable are sorted by each character in the items present.

    Numerically and alphabetically(numbers before alphabets).


    Like-

    'NFO:NIFTY2281117700CE'
    'NFO:NIFTY2281117700PE'
    'NFO:NIFTY2281817300PE',
    'NFO:NIFTY22AUG17500CE'
    'NFO:NIFTY22AUGFUT'
  • aryankejriwal4
    aryankejriwal4 edited August 2022
    ok
  • SRIJAN
    @aryankejriwal4 ,

    Yes,check my comment now.
  • SRIJAN
    SRIJAN edited August 2022
    In your case,till the expiry part ,all characters are same for all items.
    So,it was sorted according to the characters after the expiry .
    Like ,37500 PE first,then 37900(CE before PE as C comes before P),and lastly 38300 CE.
Sign In or Register to comment.