To set the entry price for your manual trade, specify the bar time when the trade was made. Note that the time you specify needs to correspond to an opening time on your chart--if it's a 3 hour chart, 6 pm or 9 pm will work, but 8 PM will not. It's not as bad as it sounds though, read on :)
Per usual I keep multiple options open.
Special features in this script:
- Change time frame for trailing
- Specify trailing parameter (high, close, hlc3, etc.)
- Change time frame for stop loss trigger (use a shorter time frame for earlier exits!)
- Specify trigger parameter (close, low, hlc3, etc.)
Remember that annoying issue where you might not be able to precisely specify entry price, because you want to use 3 hour closing prices for your trailing stop but you bought in at 7:41 pm? Add this indicator to a 1 minute chart and set your start time to 19:41, then set the trailing time frame to 3 hours!
Next stop is v2, where we take profits along the way before stop loss gets triggered.
Attempted to add trailing stop capability for short trades, but for some reason it's not working. Anybody have a clue?
This is what the Kijun Sen would be on the same chart pictured above. You'd end up selling on the 1st or 3rd depending on whether you wait for confirmation, which is fine. You could buy lower on the 3rd, but would again miss out on the final rise on the 7th.
In case you meant using Kijun Sen to take profit, I did make a version that sells on ema crosses so you can sell a little bit at a time until the final stop loss gets triggered.
That version will be much easier to modify. On line 66 just change the definition of tpma so it corresponds to the Kijun Sen instead of an EMA, and tplen on line 22 can define the period for Kijun Sen. Would you like me to try that?
I'm a little confused as how to use this and achieve the desired results however; let me explain my scenario:
I was trying to plot a trailing stop as part of a strategy I'm developing on the 4-hour chart. When I added all the information for the candle that I would have triggered in on, the script placed my entry line well below the candle on the chart. As such, I changed my time period to 1-hour intervals and assigned the trigger bar to one that would represent the value of my entry. This placed the entry level right where I wanted it. However, when I moved back to the 4-hour chart, the script broke and the entry line, as well as the trailing stop line disappeared. I had the box unchecked for use the current time frame for the indicator.
Any feedback would be incredible. Thanks!