Jump to content

Leaderboard


Popular Content

Showing most liked content since 01/27/2021 in all areas

  1. 1 point
    Hi Superee, It is the MarketPrcingTimes fields. Since these are Forex 24H trading markets, we've been using a shortcut internally and that is probably what is causing you confusion. DayofWeek 0 is Sunday and DayofWeek 5 is Friday. Since we know that FX markets open on Sunday and close on Friday, we just take the current week's Sunday and Friday dates. The actual Date returned in the field is just today's date and close time of 22:00 hours. We're ignoring the date and appending the 22:00 hours close/open times to the Sunday Start and Friday End dates to get each weeks open/close. Kind Regards, PM
  2. 1 point
    Hi Superee, Check the OrderStatusReason code that is also included in the response. It provides more information on the error and its cause. Kind Regards, PM
  3. 1 point
    Thanks for the detailed information. I will send CLOSE request with PriceTolerance value "2" so that most of the time close order would go through.
  4. 1 point
    Yes, it was DEMO Account. The outage was intermittent on Friday. Working fine this week. Thanks for checking.
  5. 1 point
    Ok, I should've guessed the "Inheritance" - may be I missed that to remember when studied the documentation. Thanks for pointing that out. I assume anytime I see something like :- ApiPrimaryMarketTagDTO > ApiMarketTagDTO I know "ApiPrimaryMarketTagDTO" class inherits from "ApiMarketTagDTO" class (in c# terms) Thanks for the info!
  6. 1 point
    Hi Superee, ApiStopLimitOrderDTO also inherits from ApiOrderDTO and all of its properties, hence the link to that DTO in the documentation. Additionally, many of the Properties are nullable and can be dropped from the reqeusts. A valid trade request with attached stops/limits can be formed as in the following example: "IfDone": [ { "Stop": { "OrderId": 778252070, "StatusReason": 1, "Status": 2, "OrderTypeId": 2, "Price": 0, "Quantity": 1000, "TriggerPrice": 1.36261, "CommissionCharge": 0, "IfDone": [], "GuaranteedPremium": 0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false }, "Limit": { "OrderId": 778252069, "StatusReason": 1, "Status": 2, "OrderTypeId": 3, "Price": 0, "Quantity": 1000, "TriggerPrice": 1.36661, "CommissionCharge": 0, "IfDone": [], "GuaranteedPremium": 0, "OCO": null, "AssociatedOrders": { "Stop": null, "Limit": null }, "Associated": false } } ], Kind Regards, PM
  7. 1 point
    Hello, You may temporarily use the address: https://platformapidocs.svc.cityindex.com/ to access the online documentation. This will be mapped to http://docs.labs.gaincapital.com/ soon, which remains it's permanent address. Kind Regards, PM
  8. 1 point
    In the demo: https://github.com/Lightstreamer/Lightstreamer-example-StockList-client-python/blob/master/src/stock_list_demo.py I would also suggest changing: def wait_for_input(): input("{0:-^80}\n".format("HIT CR TO UNSUBSCRIBE AND DISCONNECT FROM \ LIGHTSTREAMER")) To something like this: def wait_for_input(): while True: try: q = input("{0:-^80}\n".format("Press q than Enter to Unsubscribe and Disconnect from Lightstreamer")) if q == 'q': break except: break With the way it was written originally anytime you hit Enter it would exit. This way you can press 'q' than Enter to exit. Better control.
  9. 1 point
    Thanks Superee. Even though, I wrote my code in Python, your code was a good reference on what to do in the subscription. I successfully wrote everything in Python, but looking at the demo code given by Lightstreamer, I noticed that the error handling was pretty lacking. Those that are doing their code in Python, I suggest you do something like below: subscription.addlistener(on_item_update) # Adding the "on_item_update" function to Subscription sub_key = lightstreamer_client.subscribe(subscription) # Registering the Subscription try: wait_for_input() lightstreamer_client.unsubscribe(sub_key) # Unsubscribing from Lightstreamer by using the subscription key lightstreamer_client.disconnect() # Disconnecting Lightstreamer kafka_producer_obj.close() # Close Apache Kafka except KeyboardInterrupt: lightstreamer_client.unsubscribe(sub_key) lightstreamer_client.disconnect() kafka_producer_obj.close() print('Manual break by user') except Exception as e: lightstreamer_client.unsubscribe(sub_key) lightstreamer_client.disconnect() kafka_producer_obj.close() print(e) You can ignore the "kafka_producer_obj.close()". I have that because, I also use Kafka and need to close the connection on that too.
  10. 1 point
    I hope this link works. Visual Studio 2017/19 Solution Folder Ziipped . https://drive.google.com/file/d/1SavnJe6f_NRFE5-LYV9arewd893d7AdP/view?usp=sharing I created a Class to hold the rate info, and a List of that Rate Info Class - which keeps latest rate info , along with showing rates on the screen.
  11. 1 point
    Aaah Dang It! It was my Coding Error, in the "public class ApiOpenPositionDTO" I had public List<ApiAssociatedDTO> AssociatedOrders { get; set; } but CORRECT Format IS = public ApiAssociatedDTO AssociatedOrders { get; set; } Now it is DeSerializing just fine. ********* THIS THREAD /POST Can Be deleted as I found My Answer Myself But can be kept for Future Users ******
×