TradingView
codysettle
12 Jan 2024 pukul 14.36

Donch + 

AUD/USDOANDA

Deskripsi

This is an indicator I made for trading Forex to help me see the bigger picture. It is meant for the 30min TF and it includes the following:
- 20 Day High | Low
- 5 Day High | Low
- 4 Hour High | L
- 4 Hour Bars
- Daily Simple Moving Averages
- Weekly Trend Line (connects last week's open to this week's open)
- Daily Trend Line (connects yesterday's open to today's open)
- Horizontal Lines at 0.25% increments (these can be useful for S/R... currency rarely moves more than 1% in a day).
- A table with information about what markets are open and technicals on the pair I am looking at.
- A slight white background fill to highlight the first hour of the US session. Knowing what session you are in is very important in day trading (in my opinion). This lets me go back and see how the US has been trading.

To keep the chart from being "too busy" (it's plenty busy lol), I use a step line and focus on 30min closes. I reference the white lines above and below closes for 4hr highs/lows and don't bother with looking at the high/low of every 30 min bar.

For the table, you will see bright green by the country for the first hour of trading in that session. It will turn to a regular green after the first hour. It will turn yellow the final hour of that session. It will turn red if that market is closed.

You can select from the settings 'inputs' tab to enable/disable any parts of this you don't find useful, for the table you'd go over to the 'style' tab and unselect it there. For example, I don't use the labels regularly. If I were to get confused about what a moving average was or something, I'd enable the labels and clarify.

Currency doesn't like to break out and likes to be stable. Keeping this in mind, you can see how the 20 day high / low and the 5 day high / low act as support and resistance (unless there is a news event to break out on.

I have alerts for the following:
- Price update every hour
- Crossing a trend line
- Crossing a moving average
- Crossing a 0.25% increment
- Making a new 4 hour, 5 day, or 20 day high/low

To enable the alerts, you would click add alert, select the indicator, and click save. To work properly, you'd want to be on the 30min TF before doing this. You will get a lot of alerts (personally I like this because I like to see how currency moves throughout the day). You will get one notification per 30 minutes but not more than that for the particular alert.
Komentar
shortstrangle2023
Hello, congrats for the code! I am a pinescript learner and came up on your script because i was looking for a solution to the coding of an indicator I am trying to do: i am trying to calculate the lowest high (or the highest low) of the 60min candles for the last 5 trade days. For instance, we are on Friday and we want to consider all 60min candles of Thu, Wed, Tue, Mon and prev Friday, and calculates among those 60 min candles the lowest high or the highest low. I don't want to go back X candles, I want to consider exactly the previous 5 full trade days (excluding today). I am not able to tell to the code to consider only the last 5 days and in this perimeter considering a 60min timeframe while evaluating candles. Have you got any suggestions please? Thanks a lot
codysettle
@shortstrangle2023, hello! I wish I could be more help but I am just a guy that is learning code from looking at indicators and playing around a lot. If I'm understanding you correctly, you might be able to use something like ta.highest(low, 120) if you're on the 1hr charts. This would look for the highest low of the last 5 days although it would be a roll off the 121st hour and take today into consideration. I think you might be able to avoid this if you put it in an if function?
I'm guessing at all of this but maybe something like:

1) Name a variable and give it the ol' = na
var float highest_low = na

2) Set up an if function that searches for the highest low on the change of the day. That would be something like this:
if ta.change(time("D"))
highest_low := ta.highest(low, 120)

(You'd want to do := instead of = because := will 'reassign' the same variable for you every day)
I think that should work but I might be mistaken. Let me know if it helps you out and if I'm wrong, I'm sorry dude!
Lebih lanjut