Login Page - Create Account

Support Board


Date/Time: Wed, 15 May 2024 16:49:20 +0000



Post From: LastModifyPrice1 differs from Price1 in decimal places

[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