I'm Long time lurker, first time poster. Tried searching and googling my answer but couldn't seem to. Perhaps I'm thinking about this wrong and you can teach me how to code it properly. I'm trying to back test a strategy but I need help in setting up the entry and exit conditions.
Im attempting to do the adjustments to the halftrend indicator here https://usethinkscript.com/threads/half-trend-halftrend-scalper-indicator-for-thinkorswim.3305/
So I'm trying to only allow trading on after hours so 4 pm to 9.30 am ,
For the Entry : no entry signal should be executed as entry unless it appears after 4pm till 9.30 am ,
And for the exit : i want the exit to be a profit target of 5 dollars above the entry price and the stoploss at 5 dollars bellow the entry price
And i need to note that the entry signals can be both short and long , and only one position is allowed at a time
So as the picture states , if the signal is short , then the entry have a profit target x point bellow entry , and stop loss X points above , if non of the points where hit by the time a new signal appears , the position is closed on the close of the bar with the new signal and a new position is open
Can i get help on this please!
Im attempting to do the adjustments to the halftrend indicator here https://usethinkscript.com/threads/half-trend-halftrend-scalper-indicator-for-thinkorswim.3305/

So I'm trying to only allow trading on after hours so 4 pm to 9.30 am ,
For the Entry : no entry signal should be executed as entry unless it appears after 4pm till 9.30 am ,
And for the exit : i want the exit to be a profit target of 5 dollars above the entry price and the stoploss at 5 dollars bellow the entry price
And i need to note that the entry signals can be both short and long , and only one position is allowed at a time
So as the picture states , if the signal is short , then the entry have a profit target x point bellow entry , and stop loss X points above , if non of the points where hit by the time a new signal appears , the position is closed on the close of the bar with the new signal and a new position is open
Can i get help on this please!
Last edited by a moderator: