Login Page - Create Account

Support Board


Date/Time: Fri, 26 Apr 2024 22:10:17 +0000



target/stop prices are not created correctly with acsil

View Count: 2552

[2013-05-08 12:12:57]
User32496 - Posts: 26
i took that example from tradingsystem.cpp

if (sc.CrossOver(Last, SimpMovAvgSubgraph) == CROSS_FROM_BOTTOM && sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_CLOSED)
  {
    NewOrder.Target1Price = sc.Ask + 8*sc.TickSize ;
    NewOrder.Stop1Price = sc.Ask - 8*sc.TickSize;

    int Result = sc.BuyEntry(NewOrder);
    if (Result > 0) //If there has been a successful order entry, then draw an arrow at the low of the bar.
    {
      BuyEntrySubgraph[sc.Index] = sc.Low[sc.Index];

      // Remember the order IDs for subsequent modification and cancellation
      Target1OrderID = NewOrder.Target1InternalOrderID;
      Stop1OrderID = NewOrder.Stop1InternalOrderID;
    }
  }

when i compiled it and run it as an indicator (on the dax futures) to sent orders i get this error on the trade service log

Trade Order Error: Parent price (8226.500000) is more than 25% different than original Attached order price (-1.000000). Attached Order not modified. Internal order ID: 117 | 2013-05-08 08:09:52
Trade Order Error: Parent price (8226.500000) is more than 25% different than original Attached order price (16452.000000). Attached Order not modified. Internal order ID: 118 | 2013-05-08 08:09:52

what should be the correct acsil ?
thanks
[2013-05-08 16:44:30]
Sierra Chart Engineering - Posts: 104368
Not quite sure what the problem is. Use this code to set the prices:

    NewOrder.Target1Price =sc.Close[sc.Index] + 8*sc.TickSize ;
    NewOrder.Stop1Price = sc.Close[sc.Index]- 8*sc.TickSize;

Is the chart Tick Size set correctly. This is set in Chart >> Chart Settings >> Tick Size.
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
Date Time Of Last Edit: 2013-05-08 16:47:34

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account