a guest Jun 18th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- //Called by the framework whenever someone closes a price position
- private void Positions_Closed(PositionClosedEventArgs args)
- //Flag so we don't place any more orders or anything until this method completes
- _wasClosingEventFired = true;
- //other stuff this method does
- //Signal that this method is over with
- _wasClosingEventFired = false;
- //This method is called by the framework every time a new price comes in
- //This is unpredictable and could be 1ms from "now", 2 seconds from "now", etc.
- protected override void OnTick()
- private void AnalyzeMarket()
- //Does a few preliminary logging and other set ups
- if (!_wasClosingEventFired)
- //Does the brunt of the work
- //This is the code we want to make sure doesn't
- //run when a closing event happens. If that means
- //we have to wait a few "ticks", that's fine.
- //Clean up stuff
RAW Paste Data