In this lecture I want to talk about managing Order Lifecycle.
So here's our current Order Lifecycle and we're going to manage it through our trade cells shown in
orange here.
And is this cell here row 24.
And so as we move through our order process we're going to change the cell and that's going to keep
track of what stage of the order cycle we're in.
So we have a bunch of different subs that run for different stages in our order process.
And so the way we determine which subs are essentially activated or deactivated is that we use this
cell here.
So for example to send in order to some that sends our order looks for this cell here to be blank.
If it's not blank the sub won't run.
So once we send our orbiter we put something in that cell.
Now we can't run her sending orders that began so that prevents the sub from sending our order over
and over and over again.
Same thing with each stage of this process.
We only want that sub to run once and then move onto the next stage.
And so we start off with a blank cell then we send either by order or a short sell order once the order
is filled.
We can't just south the open set as we set up our code.
Once that code is run we changes out the oving.
Now we have an open position.
We stayed in an open position state until we either get our price target or we get stopped up.
So if we get our price target we changed to it said once that order is submitted.
We change it to exit.
Once that order is filled we change it to win.
Now for an open state and you get stopped out.
We go right to the stop out phase and then once that are still we do it ourselves and there really these
cells that are just filled and then recalculate again.
And if we're in our trade and we don't care price target we don't hit or stop but we hit some sort of
time criteria where we just want to exit the trade in the middle somewhere.
I mean used.
I'm out here.
Once our orders filled do it themselves.
OK.
So we're using a cell to keep track of our order.
But if you think about it why don't we use a variable to do the same thing.
Why not use a variable to keep track of where we are in our process.
Well there's a few reasons for using a cell.
First of all a cell you can see which is nice.
Another reason is if you want to change this manually you can you can easily do so just by typing something
else into the cell.
The other reason is that if you suppose you have a trait you want to hold overnight you have some open
positions.
If you save your workbook and close it reopen it the next morning this open value in your cell is still
going to be there whereas your variables they're all going to be reset to zero.
OK so we're going to be talking about each one of these subs and each one of these phases or a cycle
in more detail some of the other lectures.
I just want to give you an overview of what our site looks like and how we manage it.