placing an order other than the current price

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KYNASTON76
    Junior Member
    • Jan 2019
    • 5

    #1

    placing an order other than the current price

    Hi, Im have difficulties trying to place an order at a price that is say 10 ticks away from the current price in my c# application. It successfully places a back/lay but always seems to do it at the current price, not at the price ive passed in (MyPrice) which will be several ticks away.

    Can anybody see anything wrong with the below. Im using a live app key.

    Thanks



    IList<PlaceInstruction> placeInstructions = new List<PlaceInstruction>();
    var placeInstruction = new PlaceInstruction();
    placeInstruction.Handicap = 0;
    placeInstruction.Side = MySide;

    placeInstruction.OrderType = OrderType.LIMIT;
    var limitOrder = new LimitOrder();
    limitOrder.PersistenceType = PersistenceType.LAPSE;

    limitOrder.Price = (double)MyPrice;

    limitOrder.Size = MySize;

    placeInstruction.LimitOrder = limitOrder;
    placeInstruction.SelectionId = Int32.Parse(Convert.ToString(SelectionID));

    placeInstructions.Add(placeInstruction);


    var placeExecutionReport = new PlaceExecutionReport();
    placeExecutionReport = client.placeOrders(Marketid, null, placeInstructions);
  • KYNASTON76
    Junior Member
    • Jan 2019
    • 5

    #2
    my apologies, ive just tried hardcoding the (double) MyPrice above to 1.2 which worked, so it looks like a problem with the variable.
    Thanks

    Comment

    • jabe
      Senior Member
      • Dec 2014
      • 705

      #3
      If you're still struggling, see about getting the JSON for us. It's much easier to see errors that way.

      Comment

      • KYNASTON76
        Junior Member
        • Jan 2019
        • 5

        #4
        will do, thanks for that

        Comment

        • jabe
          Senior Member
          • Dec 2014
          • 705

          #5
          Actually, just a thought - might you be trying to back at lower than the current price, or lay at higher than the current price, hoping it'll get matched when the price moves to the price you've specified?

          Comment

          Working...
          X