import { Alpaca } from "./alpaca";
import { runDay, wait } from "./trading";

const alpaca = new Alpaca(false);

async function main() {
    while(true) {
        await runDay(alpaca);
        await wait(1000 * 60 * 60);//wait an hour before going and getting the next open
    }
}

//run main
main().then(
    () => {
        console.log("done")
    }
).catch(
    (e) => console.log('Error: ', e)
).finally(
    () => process.exit(0)
);
