Support Board
Date/Time: Thu, 16 Jan 2025 02:47:06 +0000
[Programming Help] - Strategy not exiting
View Count: 853
[2017-10-08 19:49:00] |
vectorTrader - Posts: 86 |
Can someone give me an idea why this is not exiting. // Create an s_SCNewOrder object.
update: The Crossover signal in the sell is the same subgraghs as Subgraph[4] and Subgraph[5]
s_SCNewOrder NewOrder; NewOrder.OrderQuantity = 1; NewOrder.OrderType = SCT_ORDERTYPE_MARKET; NewOrder.TimeInForce = SCT_TIF_GOOD_TILL_CANCELED; int Result = 0; if (sc.Subgraph[4][sc.Index] > sc.Subgraph[4][sc.Index - 5] && sc.Close[sc.Index]<sc.Subgraph[6][sc.Index] && sc.Subgraph[6][sc.Index]>sc.Subgraph[6][sc.Index - 2] && sc.Subgraph[6][sc.Index] <= sc.Subgraph[6][sc.Index - 3] && sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_CLOSED) { 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]; } } else if (PositionData.PositionQuantity > 0 && sc.CrossOver(FastMovAvgSubgraph,SlowMovAvgSubgraph) && sc.GetBarHasClosedStatus() == BHCS_BAR_HAS_CLOSED) { Result = sc.BuyExit(NewOrder); // If there has been a successful order entry, then draw an arrow at the high of the bar. if (Result > 0) { SellExitSubgraph[sc.Index] = sc.High[sc.Index]; } } Date Time Of Last Edit: 2017-10-08 23:01:33
|
To post a message in this thread, you need to log in with your Sierra Chart account: