Quote:
|
Originally Posted by ralph.ronnquist
I had a quick glance at the code: should the second "BUY_LEVEL = 0;" (when opening a short) rather be "SELL_LEVEL = 0;" ?
|
It does not matter. The logic is following
1. Set two levels - buy and sell
2. Wait till price hit one of these levels.
3. After that open proper order and delete both levels from memory as we open only one order per day.
So if BUY_level = 0, it means that the order was already opened and we should do nothing and wait the starting hour when new levels will be set. After opening order BUY_level loses his meaning as price level and becames a flag "all done for today, relax and don't try to open anything else"
4. 23.5 hour after starting hour open order (if still exists) will be closed on market price.