Login Page - Create Account

Support Board


Date/Time: Fri, 29 Nov 2024 05:41:03 +0000



Post From: ACS_Source\TradingSystemBasedOnAlertCondition.cpp and new Flatten OrderActionOnAlert

[2023-03-04 01:18:36]
User719512 - Posts: 267
Hi Sierra,
Looks like you added this new Flatten OrderActionOnAlert recently.
Shouldn't this new block be setting Subgraph_BuyEntry/Subgraph_SellEntry if there was a position to be flattened?

Possible missing code in your sample code.


      else if (Input_OrderActionOnAlert.GetIndex() == 4)// Flatten
      {
          if (PositionData.PositionQuantity < 0)
          {
            Subgraph_BuyEntry[BarIndex] = 1;
            Subgraph_SellEntry[BarIndex] = 0;
          }
          else
          if (PositionData.PositionQuantity > 0)
          {
            Subgraph_BuyEntry[BarIndex] = 0;
            Subgraph_SellEntry[BarIndex] = 1;
          }

          if (IsTradeAllowed && StateHasChanged)