komodo_pricesinit

This commit is contained in:
jl777
2019-04-10 20:39:55 -11:00
parent 26c7135e37
commit 2993a76b30
3 changed files with 18 additions and 0 deletions

View File

@@ -2526,3 +2526,19 @@ int64_t komodo_pricesmoothed(int64_t *correlated,int32_t cskip,int64_t *rawprice
return(price);
}
void komodo_pricesinit()
{
FILE *fp; char symbol[65]; int32_t i;
boost::filesystem::path pricefname,pricesdir = GetDataDir() / "prices";
if (!boost::filesystem::exists(pricesdir))
{
boost::filesystem::create_directories(pricesdir);
for (i=0; i<KOMODO_MAXPRICES; i++)
{
if ( komodo_pricename(symbol,i) == 0 )
break;
pricefname = pricesdir / symbol;
fp = fopen(pricefname.string().c_str(), "wb+");
}
}
}