tso_trade

Custom Time Range Pre Market Breakout - Scalp and Swing

tso_trade Updated   
This indicator uses time range (which you can customize as needed, the original idea was to use it for pre-market range breakout only and by default it’s setup for US NY pre-market range, but any range can be useful and can be set as pleased, the time is in ET within the indicator settings). Position open is per breakout from the setup time range for signals, then round numbers with smart formula as price targets for scalp approach and the whole time range distance price targets for swing approach.
There are a bunch of settings you can manually change to trade any instrument, any style, any approach. Alerts correspond to indicator settings and can be turned on with a few clicks (NOTE: every time you change settings in the indicator – you will need delete the current alerts and re-create it). There are 2 tables (each can be shown/hidden) showing stats, which you can use to calibrate the indicator as you wish.

Labels, lines, colors explanations:
- LONG Labels: medium-green: position open, dark-green: SL, bright-green: TP, blue: TP2
- SHORT Labels: medium-red: position open, dark-red: SL, bright-red: TP, purple: TP2
- Gray circles: position entry area
- Green small (scalp) | large (swing) circles: Long TP1 (blue: TP2) | Red: Short TP1 (purple: TP2)
- Grey lines: Round Numbers (customized via “Round Number up/down measure unit” input)
- Yellow labels at end of each week: end of week OVERALL total results
- Red colored background: power segment
- 2 tables: INFO | STATS for each strategy

Indicator Settings / Calibration explanation:
- Date Range:
>>>>> Select your start and end date (uncheck “End” for indicator to show results up to the very moment and to use for LIVE trading) for the trading engine of the indicator, signals, alerts, TP1, TP2, etc.

- Table Stats Settings:
>>>>> Strategies results tables location/position/show/hide.

- Global Settings:
>>>>> Intraday Session Signals Active Time in ET: time range during the day when indicator will show signals (open trades, alert you, etc.). This is specifically for intraday trading or for whatever schedule you want. You can turn it off completely by checking “Turn off trading schedule”, that way signals, TP1, TP2, alerts, etc. will be active 24/7.
>>>>> Intraday TP/SL Active Time in ET: same as signals, but for taking profits/stop losses, if “trading schedule” is turned off > this setting will be off as well.
>>>>> Close Position Before Market Closes: just what the title says. Indicator will close the position 15 minutes before market closes (US session), update backtesting stats, alert you.
>>>>> Close Position Before Power Hour: 3PM – 4PM ET is the last hour of US trading session, where sudden move in any direction can happen with huge volatility, while sometimes nothing will happen at all… Many try to avoid it, so if you wish to avoid it as well - turn this on and it will alert you to close your positions 15 minutes before Power Hour starts, backtesting/stats will be adjusted accordingly.
>>>>> The rest of the global settings are visual/cosmetic.

- Strategy Global Settings:
>>>>> Time Range: You will see the times in ET of various pre-market ranges, otherwise it is pre-set to US NY pre-market range. You can basically capture or select any time range you want, like last hour breakout for example… The only thing to note here - depending on which broker you will be using to display your instrument – it may be off from the time you will be selecting inside the Indicator Settings, for example, I used Bitcoin by COINBASE for live testing and I had to add 6 hours to the current time and then select that inside the Indicator Settings to match the last 15 or 30 minutes. But you should be able to figure it out, mainly – it must be in the past. Once you have selected the time range, you will see it enclosed inside the 2 blue lines based on the price top/bottom, after the time range is over, top and bottom lines will extend with small crosses, which are now part of active trading - if broken by the price > a position will be open.
>>>>> Time Range Top/Bottom Style: “High/Low (candle top + bottom)” – time range will be based off the tips of the candle bar sticks, “Open/Close (candle body)” – time range will be based off candle bar bodies
>>>>> Include MA/ATR to confirm breakout, LONG breakout will only be opened if MA/ATR is bullish / SHORT if MA/ATR is bearish. I suggest you play around with this setting as it may make a significant difference in trading stats/results!

- STRATEGIES (SCALP / SWING – they are pretty much the same, the only different is – TP1 (initial take profit) distance, for SCALP it is per NEAREST/SMART FORMULA round numbers for TP1 and for TP2 | for SWING it is the whole Time Range distance for TP1 and double the time range distance for TP2):
>>>>> (SCALP/SWING STRATEGY) – on/off: show/hide the whole strategy on chart/alerts/etc. if you wish to only use one of the strategies.
>>>>> SCALP/SWING SL(stop-loss) style: 1) Opposite Range Line Broken (closed candle): stop-loss is considered when price breaks opposite range line from the line you open the position, in another words – this would be a bigger stop-loss, but more room for the trade | 2) Same Range Line Broken (closed candle): stop-loss is considered when price breaks the same range line from which you open the position, there would be much more stop-losses – less breathing room for the trade, but each stop-loss would be significantly smaller.
>>>>> Position open style: 1) live breakout: Once the price breaks out from the time range – a position is considered opened immediately | 2) closed candle breakout: Only once candle bar closes above/below the time range – a position is considered opened.
>>>>> TP1 System: 1) NEAREST: nearest round number from position open or candle close, based on the position open style | 2) SMART FORMULA: more rewarding take-profit round number depending on where the position is opened.
>>>>> TP1/TP2 offset: this one is really cool, with this feature you can hunt these conditions when the price comes very near the profit target area, but never touches it. With this setting turned on and with a good offset amount – you will be able to catch these near-miss occurrences!
>>>>> TP1/TP2 offset amount: just what the title says, please be careful with this as this number varies significantly depending on the instrument you will be trading. Examples: 1) For SPY 0.1 would be $0.10 offset - if TP1 is $400 and price hits $399.90 > TP1 considered taken/signal shown/alert) | 2) For EURUSD, it is very different and if wrong will show TP1 immediately at position open, typical good offset for EURUSD is: 0.0005 | 3) For BTCUSD, 10 - $10 offset, if TP is $15,000 > $14,990, etc.
>>>>> Round Number up/down measure unit (in dollars $): this one is very important if you will be using “MANUAL” selection to build your own setup as it is very different for every instrument. For SPY, round numbers are single dollars or even half-dollar 50 cent numbers: 1 or 0.5 (350, 351, 352, etc. or 350.50, 351, 351.50, 352, etc.), while for Bitcoin (BTCUSD) a single unit ($1) is too small to be a round number as Bitcoin moves much faster and wider every second and it would have to be at least 50 ($50) to make sense. Similar for FOREX (EUR/USD) a single 1 unit ($1) will be too big as EURUSD will never move a whole $1 in 15 minutes or even a day.. and would have to be something like 1.05500. You can easily determine if this number makes sense for your instrument by observing the grey Round Number lines which will correspond based on this setting. You can also visually observe if the price of the instrument appreciates these round numbers.
>>>>> TP1 hit type: “close” > candle must close on top/crossing the price target line, “touch” > once candle touches the price target – you will be immediately alerted to take the partial profit (if you will use such setting – you will need to take the partial profits as soon as you receive the alert. NOTE: If you will turn on multi-profit system > this setting will be locked to “close”!
>>>>> Include TP2 System? Turn on/off multi-profit system, with this unchecked, every trade will either end with SL or with TP1.
>>>>> TP2 System: 1) NEAREST: nearest round number from position open or candle close, based on the position open style | 2) SMART FORMULA: more rewarding take-profit round number depending on where the position is opened.
>>>>> TP1/TP2 division type: 1) Each price target (TP1, TP2) will be ½ of the position 2) TP1 will be 2/3 of the position and TP2 will be the remaining 1/3.
>>>>> TP2 hit type: “close” > candle must close on top/crossing the price target line, “touch” > once candle touches the price target – you will be immediately alerted to take the partial profit (if you will use such setting – you will need to take the partial profits as soon as you receive the alert to stay consistent with the strategy).
>>>>> TP1 > Back to Entry hit type: similar to TP1/TP2, “close” > candle close, “touch” > candle touch. Please note: this is a very tricky setting as if you use “close” option – your profitable trade may become a loss if a huge candle will close against your position eliminating your TP1 profit, however often the price will touch and cross the entry area to only bounce and continue with your position direction for even bigger profits… so experiment with the date range results to see what works best for your instrument/setting/strategy.

*** To add the alerts
-Right-click anywhere on the TradingView chart
-Click on Add alert
-Condition: Select this indicator by it’s name
-Alert name: Whatever you want
-Hit “Create”
-Note: If you change ANY Settings within the indicator – you must DELETE the current alert and create a new one per steps above, otherwise it will continue triggering alerts per old Settings!

NOTE: You may get a repaint warning when setting up the alerts!
Here is why: If you use "touch" hit/"live" breakout options > when price is breaking out "live" or hitting your price target(TP1) or hitting your stop-loss(SL) per "touch" setting (if selected) > the condition is true right during that moment and it will print a label of Open/TP1/SL and you will receive an alert, which is set to trigger "Once Per Bar" with "live"/"touch" settings. If on that same candle bar > price goes backwards and the condition for Open/SL/TP1 is no longer true > technically the label will disappear, making the TP1 condition no longer true LIVE, which basically is repainting, however - per indicator trading rules > you are considered to have taken the TP1 already (the stats calculations inside the script > take that into account as well), so while technically it does repaint > in reality it does not affect your trading results or the indicator stats!
Release Notes:
* Fixed EOD (end of day) labels so that if both strategies are turned on - both could be seen (they were one on top of each other)
Release Notes:
* Fixed an issue where it would not show SCALP: TP1 per touch with closed candle breakouts
Release Notes:
* Minor fix in indicator settings > better wording
Release Notes:
* Here is a video guide explaining the indicator in full details: www.youtube.com/watch?v=OeItLVQe...
Release Notes:
* ATR and MA fix as it was repainting in rare cases
Release Notes:
* Added risk/reward ration to the stats table
Release Notes:
* Minor fixes to moving average/ATR check for position opening, tip: this feature can be turned on/off
Release Notes:
* Seems like TradingView pushed some sort of an update, which broke date format display, which in turn started failing the whole indicator/script... fixed it
Release Notes:
* Minor fix

Trading like a machine!
Invite-only script

Access to this script is restricted to users authorized by the author and usually requires payment. You can add it to your favorites, but you will only be able to use it after requesting permission and obtaining it from its author. Contact tso_trade for more information, or follow the author's instructions below.

Please note that this is a private, invite-only script that was not analyzed by script moderators. Its compliance to House Rules is undetermined. TradingView does not suggest paying for a script and using it unless you 100% trust its author and understand how the script works. In many cases, you can find a good open-source alternative for free in our Community Scripts.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Author's instructions

Please contact me directly if you have any questions. Video guide: www.youtube.com/watch?v=OeItLVQe...

Want to use this script on a chart?

Warning: please read before requesting access.