• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 10:29am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 10:29am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

How to make EA that send Open Price of Candle for every new candle 5 replies

How to get an Open price at specific time? 4 replies

EA to place order on specific time and specific price 2 replies

Howto get a Candle (High/Low/Open/Close) at any specific time 4 replies

Open several pairs at specific time 13 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe

Candle's Open of Specific Time

  • Post #1
  • Quote
  • First Post: Sep 8, 2016 4:46pm Sep 8, 2016 4:46pm
  •  mdswamp
  • | Joined Sep 2013 | Status: Member | 55 Posts
Hi Guys..
I'm trying to code an indicator to show Open of the current Day on the window and I want to see it changes when day changes.. I wrote this indicator (and I'm still not sure that its right ), but it seems it doesn't change when day changes. can someone help me to solve this problem. thanks.

Inserted Code
#property indicator_chart_window
extern datetime FirstTime=D'1:00';

double  DayOpen=iOpen(NULL,0,iBarShift(NULL,0,FirstTime));

int init()
  {
    ObjectCreate("OP", OBJ_LABEL, 0, 0, 0, 0, 0);
    ObjectSet("OP", OBJPROP_CORNER, 0);
    ObjectSet("OP", OBJPROP_YDISTANCE, 15);
    ObjectSet("OP", OBJPROP_XDISTANCE, 200);
    ObjectSetText("OP", " ",5, "Arial", CLR_NONE);
   
   return(0);
  }
 
int deinit()
 {
    ObjectDelete("OP");
    return(0);
 }
int start()
{
         ObjectCreate("O", OBJ_LABEL, 0, 0, 0, 0, 0);
         ObjectSet("O", OBJPROP_CORNER, 0);
         ObjectSet("O", OBJPROP_YDISTANCE, 20);
         ObjectSet("O", OBJPROP_XDISTANCE, 5);
         ObjectSetText("O", "Open Price of The Day =",12, "Arial", clrAqua);
         ObjectSetText("OP", DoubleToStr(DayOpen, 4), 20, "Arial Bold", clrRed);
   
   return(0);
}
  • Post #2
  • Quote
  • Sep 8, 2016 5:01pm Sep 8, 2016 5:01pm
  •  MikeF
  • | Joined Jul 2015 | Status: Member | 35 Posts
Why don't you just simply use iOpen(Symbol(),PERIOD_D1,0)?
 
 
  • Post #3
  • Quote
  • Sep 9, 2016 4:53am Sep 9, 2016 4:53am
  •  mdswamp
  • | Joined Sep 2013 | Status: Member | 55 Posts
Hi Mike, Thanks man, actually I get confused when I want to use time in meta..
 
 
  • Post #4
  • Quote
  • Last Post: Sep 9, 2016 6:06am Sep 9, 2016 6:06am
  •  mdswamp
  • | Joined Sep 2013 | Status: Member | 55 Posts
But still, it doesn't work, for example when I want to backtest, it just show today open
 
 
  • Platform Tech
  • /
  • Candle's Open of Specific Time
  • 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 / ©2022