• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 3:36am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 3:36am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

How difficult to make 10 pips every day with only one hour trading? 29 replies

Sends an email every hour of current price? 7 replies

I need a simple verticle line indicator.. 8 replies

Only place 1 order every hour 0 replies

Looking for a simple indicator for plotting verticle lines 5 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 4
Attachments: Create a verticle line at certain hour for every certain hour
Exit Attachments
Tags: Create a verticle line at certain hour for every certain hour
Cancel

Create a verticle line at certain hour for every certain hour

  • Post #1
  • Quote
  • First Post: May 21, 2008 3:30am May 21, 2008 3:30am
  •  NipthePips
  • | Joined Jul 2006 | Status: Your friendly Daily Pip Nipper. | 399 Posts
Hello, I am trying to create an indicator that draws a line at the beginning and end of each session, that means three times out the day it will draw a vertical line. How can I make code it so that it draws this line at those certain hour from now on?


Thanks,

Nip
Nothing is hard, some things just take more time and discipline.
  • Post #2
  • Quote
  • May 21, 2008 3:43am May 21, 2008 3:43am
  •  Islander
  • Joined Jan 2007 | Status: Member | 11,776 Posts
Quoting NipthePips
Disliked
Hello, I am trying to create an indicator that draws a line at the beginning and end of each session, that means three times out the day it will draw a vertical line. How can I make code it so that it draws this line at those certain hour from now on?


Thanks,

Nip
Ignored
Is this what you're looking for? - it has 4 lines / day or you can superimpose them to reduce the number shown....
Attached File(s)
File Type: ex4 Trading Session vLines.ex4   8 KB | 887 downloads
Trading Levels with WRBs & Aggressive, Volatile Volume
 
 
  • Post #3
  • Quote
  • May 21, 2008 3:55am May 21, 2008 3:55am
  •  NipthePips
  • | Joined Jul 2006 | Status: Your friendly Daily Pip Nipper. | 399 Posts
Quoting Islander
Disliked
Is this what you're looking for? - it has 4 lines / day or you can superimpose them to reduce the number shown....
Ignored
Thnx for the indicator...but it only display UK open and close and the US open, as well as a day separator. You wouldnt happen to have the mq4 file to it? I would like to look at the code and see if I can tweak it to what I like.


Thnx
Nothing is hard, some things just take more time and discipline.
 
 
  • Post #4
  • Quote
  • May 21, 2008 4:12am May 21, 2008 4:12am
  •  luxinterior
  • | Joined Nov 2006 | Status: MT4 EA Coder Since 2006 | 300 Posts
Here's the indicator I did for the DIBS method and it draws two lines for open and close of session. You can take a look at the code and see how I did it.

Hope it helps.

Lux
Attached File(s)
File Type: mq4 DIBS_TriggerLines1.2.mq4   9 KB | 897 downloads
MT4 EA, Indicator and Alert Coder Since 2006
 
 
  • Post #5
  • Quote
  • May 21, 2008 4:47am May 21, 2008 4:47am
  •  Islander
  • Joined Jan 2007 | Status: Member | 11,776 Posts
Quoting NipthePips
Disliked
Thnx for the indicator...but it only display UK open and close and the US open, as well as a day separator. You wouldnt happen to have the mq4 file to it? I would like to look at the code and see if I can tweak it to what I like.


Thnx
Ignored
you can set the times to any hour you like - open the indy, edit and double click on any line to highlight the hour and then change it....
Trading Levels with WRBs & Aggressive, Volatile Volume
 
 
  • Post #6
  • Quote
  • May 21, 2008 5:09am May 21, 2008 5:09am
  •  NipthePips
  • | Joined Jul 2006 | Status: Your friendly Daily Pip Nipper. | 399 Posts
Quoting Islander
Disliked
you can set the times to any hour you like - open the indy, edit and double click on any line to highlight the hour and then change it....
Ignored
yea i got that part...but it still only displays 3 lines...would liek it to show all sessions at once...
Nothing is hard, some things just take more time and discipline.
 
 
  • Post #7
  • Quote
  • May 21, 2008 5:48am May 21, 2008 5:48am
  •  nvwine
  • Joined Feb 2005 | Status: Member | 1,747 Posts
NipthePips,

Here is something to play with.
Attached File(s)
File Type: mq4 mMktOpen.mq4   7 KB | 821 downloads
 
 
  • Post #8
  • Quote
  • May 21, 2008 6:43am May 21, 2008 6:43am
  •  Islander
  • Joined Jan 2007 | Status: Member | 11,776 Posts
Quoting NipthePips
Disliked
yea i got that part...but it still only displays 3 lines...would liek it to show all sessions at once...
Ignored
mm - actually there are 4 lines.....
Trading Levels with WRBs & Aggressive, Volatile Volume
 
 
  • Post #9
  • Quote
  • May 21, 2008 3:59pm May 21, 2008 3:59pm
  •  NipthePips
  • | Joined Jul 2006 | Status: Your friendly Daily Pip Nipper. | 399 Posts
Quoting Islander
Disliked
mm - actually there are 4 lines.....
Ignored

LOL ok and the day separator....my point still stands lol....but thnx anyways
Nothing is hard, some things just take more time and discipline.
 
 
  • Post #10
  • Quote
  • May 21, 2008 4:18pm May 21, 2008 4:18pm
  •  NipthePips
  • | Joined Jul 2006 | Status: Your friendly Daily Pip Nipper. | 399 Posts
Quoting nvwine
Disliked
NipthePips,

Here is something to play with.
Ignored

Love it!, so far it looks right...thnx!
Nothing is hard, some things just take more time and discipline.
 
 
  • Post #11
  • Quote
  • May 21, 2008 9:54pm May 21, 2008 9:54pm
  •  darkkiller
  • | Joined Apr 2008 | Status: Member | 35 Posts
Quoting nvwine
Disliked
NipthePips,

Here is something to play with.
Ignored
1.historical line for this indicator too short...can it have longer period historical line?example we can backtest for 365day (year)

2.can it have abillity to switch on/off for market open line and switch on/off for market close?

thanks
 
 
  • Post #12
  • Quote
  • May 22, 2008 1:51am May 22, 2008 1:51am
  •  NipthePips
  • | Joined Jul 2006 | Status: Your friendly Daily Pip Nipper. | 399 Posts
Quoting darkkiller
Disliked
1.historical line for this indicator too short...can it have longer period historical line?example we can backtest for 365day (year)

2.can it have abillity to switch on/off for market open line and switch on/off for market close?

thanks
Ignored

Umm what i did was added a variable called "BarsToCount" as an extern

changed the function where it counts bars and sets the total number to be that variable.. so that way the user can enter in how many bars they want it to calculate until....



here is a snippet of each place where i edited code that way you can find it and add it in


Inserted Code
extern int SydneyOpenDataTime=1;
extern int TokyoOpenDataTime=2;
extern int HongKongOpenDataTime=3;

[b]extern int BarsToCount=1000;[/b]

extern color NYColor=Sienna;


Inserted Code
int start()
   {
   int counted_bars=IndicatorCounted();
   int bars_count=BarsToCount,i,h,m;
   bool drawvl;
   if (Period()>PERIOD_H1) 
      {
         return(0);    //If time > 1 hour clutters up screen
      }
   for (i=0;i<bars_count;i++)

Then when you run it, when you are editing the inputs, change the barstocount variable to whatever, i usually set mine at between 1000-3000 depending on how much data you have.

Then again, i guess i can upload the indicator lmao...
Attached File(s)
File Type: mq4 mMktOpen.mq4   7 KB | 917 downloads
Nothing is hard, some things just take more time and discipline.
 
 
  • Post #13
  • Quote
  • May 22, 2008 11:47am May 22, 2008 11:47am
  •  darkkiller
  • | Joined Apr 2008 | Status: Member | 35 Posts
thanks nip..everything work nicely..
 
 
  • Post #14
  • Quote
  • Jun 10, 2008 4:31am Jun 10, 2008 4:31am
  •  rpasupathy
  • Joined May 2008 | Status: Member | 319 Posts
Quoting luxinterior
Disliked
Here's the indicator I did for the DIBS method and it draws two lines for open and close of session. You can take a look at the code and see how I did it.

Hope it helps.

Lux
Ignored
Hi Luxinterior,

Thanks for the indicator. Can you please tell me how to trade on that ??

Cheers
The One Who Makes The Thunder Roar Also Hears A Butterfly Sigh - Ruzbeh
 
 
  • Post #15
  • Quote
  • Jan 7, 2009 7:10pm Jan 7, 2009 7:10pm
  •  Rengoku
  • | Joined Aug 2008 | Status: Member | 45 Posts
Quoting NipthePips
Disliked
Umm what i did was added a variable called "BarsToCount" as an extern

changed the function where it counts bars and sets the total number to be that variable.. so that way the user can enter in how many bars they want it to calculate until....



here is a snippet of each place where i edited code that way you can find it and add it in


Inserted Code
extern int SydneyOpenDataTime=1;
extern int TokyoOpenDataTime=2;
extern int HongKongOpenDataTime=3;
 
[b]extern int BarsToCount=1000;[/b]
 
extern color NYColor=Sienna;


[code]int start()...
Ignored

mMktOpen.mq4
Is there any way of having this indicator shift forward? I would like it to display 1 day ahead... at least as much as I can see.

Thanks for the help!
 
 
  • Post #16
  • Quote
  • Jan 8, 2009 8:08am Jan 8, 2009 8:08am
  •  Rengoku
  • | Joined Aug 2008 | Status: Member | 45 Posts
Is there any way to have this indicator project time forward??? I would like to see the opens before they occur.

Inserted Code
#property indicator_chart_window
extern bool NY=true;
extern bool London=true;
extern bool Auckland=false;
extern bool Sydney=false;
extern bool Tokyo=true;
extern bool HongKong=false;
extern bool t30MinAdvanceNotice=false;     //display dashed line 30 minutes before opening?
//Data provider times for openings
extern int NYOpenDataTime=15;
extern int LondonOpenDataTime=10;
extern int AucklandOpenDataTime=21;
extern int SydneyOpenDataTime=24;
extern int TokyoOpenDataTime=2;
extern int HongKongOpenDataTime=4;
extern color NYColor=DimGray;
extern color LondonColor=DimGray;
extern color AucklandColor=DimGray;
extern color SydneyColor=DimGray;
extern color TokyoColor=DimGray;
extern color HKColor=DimGray;
double val1,val2;
int deinit()
  {
   int bars_count=BarsPerWindow(), i;
   for (i=0;i<bars_count;i++)
      {
      ObjectDelete("MMt"+DoubleToStr(i,0));
      ObjectDelete("MMl"+DoubleToStr(i,0));
      }
   return(0);
  }
//----------------------------------------------------------------------------------------
int start()
   {
   int counted_bars=IndicatorCounted();
   int bars_count=BarsPerWindow(),i,h,m;
   bool drawvl;
   if (Period()>PERIOD_D1) 
      {
         return(0);    //If time > 1 day clutters up screen
      }
   for (i=0;i<bars_count;i++)
      {
      ObjectDelete("MMt"+DoubleToStr(i,0));
      ObjectDelete("MMl"+DoubleToStr(i,0));
      }
   for (i=0;i<bars_count;i++)
      {
         drawvl=false;
         h=TimeHour(Time[i]);
         m=TimeMinute(Time[i]);
         if (London==true)
            {
               if ((h==LondonOpenDataTime) && (m==0)) {drawvl=true;VerticalLine("LO",i,STYLE_SOLID,LondonColor);}
               if ((h==TimeAdjust(LondonOpenDataTime,0)) && (m==0)) {drawvl=true;VerticalLine("LC",i,STYLE_DASH,LondonColor);}
               if (t30MinAdvanceNotice==true)
                  {
                     if ((h==TimeAdjust(LondonOpenDataTime,1)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,LondonColor);}
                     if ((h==TimeAdjust(LondonOpenDataTime,2)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,LondonColor);}
                  }
            }
         if (NY==true)
            {
               if ((h==NYOpenDataTime) && (m==0)) {drawvl=true;VerticalLine("NYO",i,STYLE_SOLID,NYColor);}
               if ((h==TimeAdjust(NYOpenDataTime,0)) && (m==0)) {drawvl=true;VerticalLine("NYC",i,STYLE_DASH,NYColor);}
               if (t30MinAdvanceNotice==true)
                  {
                     if ((h==TimeAdjust(NYOpenDataTime,1)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,NYColor);}
                     if ((h==TimeAdjust(NYOpenDataTime,2)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,NYColor);}
                  }
            }
         if (Auckland==true)
            {
               if ((h==AucklandOpenDataTime) && (m==0)) {drawvl=true;VerticalLine("Auck O",i,STYLE_SOLID,AucklandColor);}
               if ((h==TimeAdjust(AucklandOpenDataTime,0)) && (m==0)) {drawvl=true;VerticalLine("Auck C",i,STYLE_DASH,AucklandColor);}
               if (t30MinAdvanceNotice==true)
                  {
                     if ((h==TimeAdjust(AucklandOpenDataTime,1)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,AucklandColor);}
                     if ((h==TimeAdjust(AucklandOpenDataTime,2)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,AucklandColor);}
                  }
            }
         if (Sydney==true)
            {
               if ((h==SydneyOpenDataTime) && (m==0)) {drawvl=true;VerticalLine("Syd O",i,STYLE_SOLID,SydneyColor);}
               if ((h==TimeAdjust(SydneyOpenDataTime,0)) && (m==0)) {drawvl=true;VerticalLine("Syd C",i,STYLE_DASH,SydneyColor);}
               if (t30MinAdvanceNotice==true)
                  {
                     if ((h==TimeAdjust(SydneyOpenDataTime,1)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,SydneyColor);}
                     if ((h==TimeAdjust(SydneyOpenDataTime,2)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,SydneyColor);}
                  }
            }
         if (Tokyo==true)
            {
               if ((h==TokyoOpenDataTime) && (m==0)) {drawvl=true;VerticalLine("Tokyo O",i,STYLE_SOLID,TokyoColor);}
               if ((h==TimeAdjust(TokyoOpenDataTime,0)) && (m==0)) {drawvl=true;VerticalLine("Tokyo C",i,STYLE_DASH,TokyoColor);}
               if (t30MinAdvanceNotice==true)
                  {
                     if ((h==TimeAdjust(TokyoOpenDataTime,1)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,TokyoColor);}
                     if ((h==TimeAdjust(TokyoOpenDataTime,2)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,TokyoColor);}
                  }
            }
         if (HongKong==true)
            {
               if ((h==HongKongOpenDataTime) && (m==0)) {drawvl=true;VerticalLine("HK O",i,STYLE_SOLID,HKColor);}
               if ((h==TimeAdjust(HongKongOpenDataTime,0)) && (m==0)) {drawvl=true;VerticalLine("HK C",i,STYLE_DASH,HKColor);}
               if (t30MinAdvanceNotice==true)
                  {
                     if ((h==TimeAdjust(HongKongOpenDataTime,1)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,HKColor);}
                     if ((h==TimeAdjust(HongKongOpenDataTime,2)) && (m==30)) {drawvl=true;VerticalLine("",i,STYLE_DOT,HKColor);}
                  }
            }
      }
   return(0);
   }
//----------------------------------------------------------------------------------------------
int VerticalLine(string s,int i,int st,int Col)    //s=Text Label, i = bar, st=Line Style, Col = color
   {
   ObjectDelete("MMl"+DoubleToStr(i,0));
   val1=Low[Lowest(NULL,0,MODE_LOW,BarsPerWindow(),0)];
   val2=High[Highest(NULL,0,MODE_HIGH,BarsPerWindow(),0)];
   ObjectCreate("MMl"+DoubleToStr(i,0),OBJ_TREND,0,Time[i],0,Time[i],900);
   ObjectSet("MMl"+DoubleToStr(i,0),OBJPROP_COLOR,Col);
   ObjectSet("MMl"+DoubleToStr(i,0),OBJPROP_WIDTH,1);
   ObjectSet("MMl"+DoubleToStr(i,0),OBJPROP_STYLE,st);
   ObjectSet("MMl"+DoubleToStr(i,0),OBJPROP_RAY,0);
   ObjectDelete("MMt"+DoubleToStr(i,0));
   ObjectCreate("MMt"+DoubleToStr(i,0),OBJ_TEXT,0,Time[i],val2+Point*3);
   ObjectSetText("MMt"+DoubleToStr(i,0),s,8,"Arial",Col);
   ObjectSet("MMt"+DoubleToStr(i,0), OBJPROP_ANGLE, 90);          //Rotates text 90 degrees
   ObjectsRedraw();
   return(0);
   }
int TimeAdjust(int TimeIn, int ProcessType)  
   {
      if (ProcessType==0)     //Calculate Closing Hour.  Open Hour + 9 hours
         {
            if ((TimeIn>=0) && (TimeIn<=14)){return(TimeIn+9);}
            return(TimeIn-15);
         }   
      if (ProcessType==1)     //Calculate 30MinAdvanceNotice for Opening Hour
         {
            if (TimeIn==0) {return(23);}
            return(TimeIn-1);
         }
      if (ProcessType==2)     //Calculate 30MinAdvanceNotice for Closing Hour
         {
            if ((TimeIn>=0) && (TimeIn<=15)) {return(TimeIn+8);}
            return(TimeIn-16);
         }
   }
 
 
  • Post #17
  • Quote
  • Last Post: Mar 10, 2010 1:57pm Mar 10, 2010 1:57pm
  •  ArshadFX
  • | Joined Dec 2008 | Status: nMember | 17 Posts
See Thishttp://www.forexfactory.com/showpost...33&postcount=5
 
 
  • Platform Tech
  • /
  • Create a verticle line at certain hour for every certain hour
  • 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