Support Board
Date/Time: Wed, 15 Jan 2025 20:49:45 +0000
LastModifyPrice1 differs from Price1 in decimal places
View Count: 765
[2017-09-05 17:46:43] |
cross - Posts: 70 |
Hello, Version 1605. Feed: CTS T4 FIX (TopStepTrader Combine, Simulation server) I modified the AutomatedTradeManagementBySubgraph.cpp to move the stop only if it is not already closer than what the referenced study dictates. This was done by changing the EQUAL operator to LESS/GREATER_EQUAL_OPERATOR according to the stop order type (sell or buy). s_SCTradeOrder.LastModifyPrice1 differs from Price1 in decimal places. Chart: CL.20171000.CME_NY 1 Min #2 | Study: =ATM long= | 2 : 48.58 4858.00 2 48.65 | 2017-09-05 13:24:46 printed with: Buffer.Format("%d : %s %s %d %s", Order.BuySell, sc.FormatGraphValue(Order.Price1,sc.BaseGraphValueFormat).GetChars(), sc.FormatGraphValue(Order.LastModifyPrice1,sc.BaseGraphValueFormat).GetChars(), GREATER_EQUAL_OPERATOR, sc.FormatGraphValue(NewPrice,sc.BaseGraphValueFormat).GetChars());
This caused the GREATER_EQUAL_OPERATOR to always report true as checking the Price1 and LastModifyPrice1 is OR-ed. if( sc.FormattedEvaluateUsingDoubles(Order.Price1,sc.BaseGraphValueFormat, op, NewPrice, sc.BaseGraphValueFormat )
|| sc.FormattedEvaluateUsingDoubles(Order.LastModifyPrice1, sc.BaseGraphValueFormat, op, NewPrice, sc.BaseGraphValueFormat) So for example a long position's sell stop was not moved higher because of the LastModifyPrice1 was always greater then the indicator's price even if the Price1 was still lower and so should be moved up to the level of the indicator. I think both Price1 and LastModifyPrice1 should be on the same decimal scale. I assume that this is related to the data feed's price format but I am not sure. Thanks |
[2017-09-05 18:14:13] |
Sierra Chart Engineering - Posts: 104368 |
I think both Price1 and LastModifyPrice1 should be on the same decimal scale. I assume that this is related to the data feed's price format but I am not sure. 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 |
To post a message in this thread, you need to log in with your Sierra Chart account: