Login Page - Create Account

Support Board


Date/Time: Fri, 27 Dec 2024 18:01:51 +0000



Post From: Opening Stock Option position from a Stock Chart

[2015-12-08 22:11:46]
User99735 - Posts: 234
  s_SCNewOrder NewOrder;

  NewOrder.OrderQuantity = 1; //optionPos->Qty[CALLPUT];
  NewOrder.OrderType = SCT_ORDERTYPE_MARKET;
  NewOrder.TimeInForce = SCT_TIF_DAY;
  //NewOrder.Price1 = (double) optionPos->OptionEntryPrice[CALLPUT];
  NewOrder.OCOGroup1Quantity = NewOrder.OrderQuantity;
  if (PermData->OrderData[TargetOffset] > 0)
    NewOrder.Target1Offset = (double)PermData->OrderData[TargetOffset];
  if (PermData->OrderData[StopOffset] > 0)
    NewOrder.Stop1Offset = (double)PermData->OrderData[StopOffset];
  NewOrder.Symbol = "AAPL-OPT-20151211-118-C-SMART-100-USD";//optionPos->OptionName[CALLPUT];
  NewOrder.TradeAccount = sc.SelectedTradeAccount;

  int result = -3;
  char msg[1000];

  if (optionPos->LongShort[CALLPUT])
  {
    result = sc.BuyEntry(NewOrder);
  }
  else
  {
    result = sc.SellEntry(NewOrder);
  }

and in the sc.defaults section the following variables are set

    sc.MaintainTradeStatisticsAndTradesData = true;
    sc.AllowOnlyOneTradePerBar = false;
    sc.AllowMultipleEntriesInSameDirection = true;
    //sc.MaximumPositionAllowed = 20;
    sc.SupportReversals = true;
    sc.SupportAttachedOrdersForTrading = false;
    sc.AllowOppositeEntryWithOpposingPositionOrOrders = true;
    sc.CancelAllOrdersOnEntriesAndReversals = true;
    sc.AllowEntryWithWorkingOrders = true;
    sc.CancelAllWorkingOrdersOnExit = true;
    sc.UseGUIAttachedOrderSetting = false;
    sc.ReceiveNotificationsForChangesToOrdersPositionsForAnySymbol = true;