Hi. I'm working on my first Strategy to hopefully do some back testing. I have everything pretty much working except for the very end. I have what I'm calling signal1 defined and a order to buy:
AddOrder(OrderType.BUY_TO_OPEN, signal1, tickColor = GetColor(0), arrowColor = GetColor(0), name = "Long");
What I can't figure out is how to code a sell to close order after price hits my target or stop. For simplicity's sake let's say I want to sell to close once price is $1.00 (up or down) from my entry price.
AddOrder(OrderType.SELL_TO_CLOSE ???
I assume it's going to be something with entryprice, close, and/or ohlc, but I'm new to ThinkScript and can't figure it out. Any help is greatly appreciated. Thank you.
AddOrder(OrderType.BUY_TO_OPEN, signal1, tickColor = GetColor(0), arrowColor = GetColor(0), name = "Long");
What I can't figure out is how to code a sell to close order after price hits my target or stop. For simplicity's sake let's say I want to sell to close once price is $1.00 (up or down) from my entry price.
AddOrder(OrderType.SELL_TO_CLOSE ???
I assume it's going to be something with entryprice, close, and/or ohlc, but I'm new to ThinkScript and can't figure it out. Any help is greatly appreciated. Thank you.