If you don’t like seeing blank days in your charts then make sure you tell TradeStation to skip these Holidays. It doesn’t make a difference in your calculations on a historic basis – TS skips these days already, but it’s more aesthetically pleasing not seeing the gaps.
I just learned something new! I guess I never programmed a strategy that pyramided at different price levels and scaled out at different price levels.
Initially I thought no problem. But I couldn’t get it to work – I tried everything and then I came across the keyword Total and then I remembered. If you don’t specify Total in you exit directives then the entire position is liquidated. Unless you are putting all your positions on at one time – like I did in my last post. So remember if you are scaling out of a pyramid position use Total in your logic.
If currentContracts < maxPosSize - 1 and c > average(c,50) and c = lowest(c,3) then buy("L3Close") 1 contract this bar on close;
If currentContracts < maxPosSize and c > average(c,50) and c = lowest(c,4) then buy("L4Close") 1 contract this bar on close;
If currentContracts = 2 and c = highest(c,5) then sell 1 contract total this bar on close;
If currentContracts = 1 and c = highest(c,10) then sell 1 contract total this bar on close;
Scaling Out Of Pyramid
Why you have to use the Total I don’t know. You specify the number of contracts in the directive and that is sufficient if you aren’t pyramiding. The pyramiding throws a “monkey wrench” in to the works.