Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 01:39:58 +0000



Post From: MOVE TO BREAK EVEN ORDERS

[2014-02-25 00:45:52]
Sierra Chart Engineering - Posts: 104368
    {


      //Move to breakeven on Stop Attached order

      // Create an s_SCNewOrder object.
      s_SCNewOrder NewOrder;
      NewOrder.OrderQuantity = 2;
      NewOrder.OrderType = SCT_ORDERTYPE_MARKET;

      //Define the Attached Orders to be attached to the main Market order
      //Target 1
      NewOrder.Target1Offset = 10*sc.TickSize;
      NewOrder.AttachedOrderTarget1Type = SCT_ORDERTYPE_LIMIT;

      //Common Stop
      NewOrder.StopAllOffset = 10*sc.TickSize;
      NewOrder.AttachedOrderStopAllType = SCT_ORDERTYPE_STOP;


      // Set up a move to breakeven action for the common stop.

      // This is a common setting and applies to all Stop Attached Orders set on the main order.
      NewOrder.MoveToBreakEven.Type=MOVETO_BE_ACTION_TYPE_OFFSET_TRIGGERED;

      //After 5 ticks of profit, the stop order will be moved to breakeven
      NewOrder.MoveToBreakEven.TriggerOffsetInTicks= 5;
      NewOrder.MoveToBreakEven.BreakEvenLevelOffsetInTicks= 0;

      sc.BuyOrder(NewOrder);
    }

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing