Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 21:06:05 +0000



Post From: ACSIL Custom Autotrading System assistance

[2024-08-06 10:18:39]
User431178 - Posts: 541
s_MarketDepthEntry bidDepthEntry(0); // Initialize with dummy value

Remove the (0)
s_MarketDepthEntry only has a default constructor (which takes no parameters).
When it is constructed both member variables are zero initialized anyway.

sc.VolumeAtPriceForBars->GetPriceIndexForPrice(sc.ArraySize - 1, askDepthEntry.Price, priceIndex))

This is a non-existant function, is it a ChatGPT hallucination?

Try lookng at
sc.VolumeAtPriceForBars->GetVAPElementForPriceIfExists
or
sc.VolumeAtPriceForBars->GetVAPElementAtPrice

When you use the vap container, the prices are in ticks, so you need to use sc.PriceValueToTicks to convert the price first.


volumeAtPrice->AskVolume - volumeAtPrice->BidVolume) < 0
This won't work as these values are unsigned integers.

Rather than subtracting and comparing to zero, why not compare the variables directly.

Replace
(volumeAtPrice->AskVolume - volumeAtPrice->BidVolume) < 0
with
(volumeAtPrice->BidVolume > volumeAtPrice->AskVolume)


Replace
(volumeAtPrice->AskVolume - volumeAtPrice->BidVolume) > 0
with
(volumeAtPrice->AskVolume > volumeAtPrice->BidVolume)


If your code still does not compile, post all the remaining error messages.