daytraderph

Close Trade at end of day

script serves as an example how we can close trades at end of day.

can be session controlled or the time controlled.

the session should be adjusted to be earlier than the candle time.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Kommentarer

After a lot of search, i finally got it from a fellow Indian trader. May you earn 10X this year.
+6 Svara
nice one sir
+4 Svara
When I tried this, its not working(not ending the the trade at the end of day), please guide if any changes required.
+3 Svara
ms30141 sudhakarreddyk
@sudhakarreddyk, I am not sure, but try changing your chart time resolution to 4-1 hour or even minute interval. It is not going to work with a day interval or lower time resolutions.
Svara
Thanks Brother for providing this :)
Svara
this code does't work in any time frame
Svara
daytraderph kankariyanitin
@kankariyanitin, you need to understand and tweek the code according to you need. for more you can refer below link of pine.
https://www.tradingview.com/pine-script-docs/en/v4/essential/Sessions_and_time_functions.html
Svara
Thank you!
Svara
Great work. Works for me. Also, if we use minute time interval, then on line 95 and 98 we would write if ( hour(time) == 15 and minute(time) >= 59 )
Svara
Not working for me
Svara