OrderType as a constant in thinkscript?

RogerHill2020

New member
I am playing with Bolinger Bands. I have regular sell orders that are triggered at the upper band. I have regular buy orders that are triggered at the lower band. Then I have Buy_Auto orders to limit loss in the sell order at the top if it turns out to be just a slight correction and the trend continues up. I have similar Sell_auto orders to limit loss in the buy order at the bottom if it turns out to be just a slight correction and the trend continues down.

My problem is my orders to cut my losses and take advantage of the continued trend are crossing over to the opposite band. The result is that after the initial order I get alternating buy sell signals every other bar. Buy, sell, Buy, sell.
What I want to do is identify the last entry by OrderType or better yet, by the name I gave the order. Is there a way to reference the last entry as a constant?
 
Last edited by a moderator:

Similar threads

Top