Support Board
Date/Time: Thu, 03 Jul 2025 09:00:35 +0000
Post From: Spread Order Entry spread price seems wrong
[2021-01-13 12:04:49] |
weav - Posts: 46 |
Ah thanks. i see that SpreadOrderStudy.cpp file is in ACS_Source. I've looked at the code and how it calculates the value, and i can see the issue. As mentioned i chart my spreads in terms of dollar value, e.g. 50*{ESH21}-1000*{CLH21}, which to an inter-commodity spread trader is more useful than a spread ratio number. When i setup the custom symbol for 50*{ESH21}-1000*{CLH21} i make sure that TickSize=1 and CurrencyValuePerTick=1, i.e. real dollars. When i use that custom symbol in chart and add the SpreadOrderEntry study i set Leg 1 as ESH21 and Leg2 as CLH21 and Use Full Contract Values to yes. The study calculates the spread order entry price (full contract dollar value) correctly. I have done this with lots of spreads and the full contract value is always calculated as expected. The only custom symbol that didn't work (and why i started this thread) is 42000*{GHOH21}-42000*{GRBH21} . Now i've looked at the code of the study i can see why. In "Symbol Settings" , one of half of the spread symbol, "GRB?##" was missing a "currency value per tick" value. I added 4.2 (RBOB Gasoline's tick value). Now the SpreadOrderEntry study calculates the full contract value of Buy 1 GHOH21 Sell 1 GRBH21 as expected and matches the 42000*{GHOH21}-42000*{GRBH21} chart y-axis. (there is a slight difference but this is because the chart y-axis must be calculated using the last traded price of each leg but the spread order entry study uses the bid and offer prices of the individual legs as those are the prices we will hit) So, there's nothing wrong with the "full contract value" setting. It was just missing Symbol config in one of the legs. I don't think there is anything for guys you to do. Appreciate you looking into it! Date Time Of Last Edit: 2021-01-13 16:27:30
|