• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 10:34pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 10:34pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

3 Bar Fractal with mid-bar and bar on each side 11 replies

Whole Number - Half Number Indicator 1 reply

Counting number of past bars since price pattern occurrence 10 replies

Number of trades before counting consistency 9 replies

Pin bar, pin bar, pin bar 0 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 2
Attachments: How to write code to create indicator for counting bar number?
Exit Attachments
Tags: How to write code to create indicator for counting bar number?
Cancel

How to write code to create indicator for counting bar number?

  • Post #1
  • Quote
  • First Post: Jun 29, 2020 10:18am Jun 29, 2020 10:18am
  •  2tjv
  • | Joined Aug 2018 | Status: Member | 28 Posts
Hi Experts,
I have traded for 4 years, but I'm still a novice at programming. I started learning how to write code a couple of days ago so that I can create my indicator for trading purposes. You can see the indicator (look at the image) which I am trying to create. Utilities of the indicator:

  1. At a specific time in the day (I mean every day), it appears number 1 below Low of the bar at that time. You can see in the image, number 1 appears below the Low of the bar at 08:00. We can simply call it is Start Trading Hour. By the way, my main TF is M5.
  2. Then, it does not show a regular sequence of numbers 1, 2, 3, 4, 5,... It shows an even number (2, 4, 6, 8,...) sequence corresponding to the bars after bar number 1.
  3. After 12 bars, the number will change color because there is the time the bar on H1 closed. 12 bars on M5 = 1 bar on H1. So the color of numbers 12, 24, 36,... will be changed.
  4. It keeps going on until a specific time like 20:00 on that day (not yesterday or tomorrow). That is End Trading Hour. After 20:00, it won't appear any numbers.
  5. Tomorrow at the same time 08:00, again... repeat and repeat...

I know I have to ObjectCreate(...), OBJ_TEXT but the time and price... I don't know how to write that...
Thank you so much for helping me!

Attached Image (click to enlarge)
Click to Enlarge

Name: EURUSDM5__1.png
Size: 21 KB
  • Post #2
  • Quote
  • Jun 30, 2020 1:58am Jun 30, 2020 1:58am
  •  2tjv
  • | Joined Aug 2018 | Status: Member | 28 Posts
Anyone help me, please!
 
 
  • Post #3
  • Quote
  • Jun 30, 2020 4:51am Jun 30, 2020 4:51am
  •  emmzett
  • Joined Apr 2008 | Status: Member | 609 Posts
Quoting 2tjv
Disliked
Anyone help me, please!
Ignored
Aren't you doing it more complicated than it is? It seems to me you want to visualize a specific time during the day in hourly intervals. So look for a session indicator and a hourly timeframe indicator.

M5 example:
Attached Image (click to enlarge)
Click to Enlarge

Name: hourly-separators.png
Size: 69 KB
 
1
  • Post #4
  • Quote
  • Last Post: Jul 13, 2020 3:12am Jul 13, 2020 3:12am
  •  2tjv
  • | Joined Aug 2018 | Status: Member | 28 Posts
Quoting emmzett
Disliked
{quote} Aren't you doing it more complicated than it is? It seems to me you want to visualize a specific time during the day in hourly intervals. So look for a session indicator and a hourly timeframe indicator. M5 example: {image}
Ignored
I am so sorry for being late!
Wew It's not simple like that. Anytime I look at the chart, I want to know the location of that bar. It's helpful for my trading. EX: When I look at Big Green Bar, I know that bar is bar number 8 because number 8 is below it, right? And I know it's coming to bar 12, bar 12 = 1 hour. At that moment (bar 8), we have 60% chance that the close of bar 12 will not below the open of bar 1 because of bar 8. So on H1, 60% chance it will be a green bar.
If the bars don't have numbers below, how do I know it has 4 more bars left for 1 hour.
 
 
  • Platform Tech
  • /
  • How to write code to create indicator for counting bar number?
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023