Title: Loading the T2 Files is Not Working
Hello, I tried to replicate the example from the manual:
https://zorro-project.com/manual/en/ordercvd.htmI slightly modified the script to only read data from 2017-2018. Here is the script:
function run()
{
// Set the test period to the years 2017-2018, matching the t2 files
StartDate = 20170101;
EndDate = 20181231;
BarPeriod = 10; // 10-minute intervals
assetList("AssetsBinance");
// Asset settings, matching the loaded t2 files
asset("BTCUSD");
// Load the order book data from 2017-2018
int N = orderUpdate("BTCUSD", 1);
if (N <= 0) {
printf("Error: No quotes loaded. Check the file and path.\n");
return; // Exit the script if no data could be loaded
}
T2* Quotes = dataStr(1, OrderRow, 0); // Access the loaded quotes
printf("\nOrder book: %i quotes loaded\n", N);
// Define the range for analyzing the order book (e.g., 5% of the current price)
var Distance = 0.05 * price(); // +/- 5%
int N2 = orderCVD(Quotes, N, Distance);
printf(", %i quotes within range\n", N2);
// Create a graphical representation of the order book data
Distance *= 1.5; // Expand the range for visualization
var Price = priceClose() - Distance;
int i;
// Visualize the Ask side (red bars)
for (i = 0; i < 100; i++) {
Price += Distance / 50;
plotBar("Ask", i, Price, cpd(Price), BARS | LBL2, RED);
}
// Reset the price for the Bid side (blue bars)
Price = priceClose() - Distance;
for (i = 0; i < 100; i++) {
Price += Distance / 50;
plotBar("Bid", i, Price, cpd(-Price), BARS | LBL2, BLUE);
}
}
The T2 and T6 data files were downloaded from the Zorro Trader download section.
In the Asset.csv file, I have the following line:
BTCUSD,1,0.01,0,0,0.0001,0.0001,0,1,1,-0.1
Unfortunately, I keep getting errors when trying to get this running.
Error: No quotes loaded. Check the file and path.
Error: No quotes loaded. Check the file and path.
Error: No quotes loaded. Check the file and path.
Error: No quotes loaded. Check the file and path.
Error: No quotes loaded. Check the file and path.
Error: No quotes loaded. Check the file and path.
Error: No quotes loaded. Check the file and path.
Error: No quotes loaded. Check the file and path.
Error: No quotes loaded. Check the file and path.
Error: No quotes loaded. Check the file and path.
Error: No quotes loaded. Check the file and path.
Error: No quotes loaded. Check the file and path.
Can someone share a working script with these T2 files?
zorro 2.63