Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

how to draw vertical lines in a strategy
 Post subject: how to draw vertical lines in a strategy Post rating: 0   New post Posted: Fri 05 Aug, 2011, 17:33 
User avatar

User rating: 1
Joined: Wed 06 Jul, 2011, 23:12
Posts: 42
Location: Romania, Bucharest
Hello,

Can somebody give an example about how I can allocate a value to a long type variable. For example I need to draw a vertical line in the chart today at 8:34 am GMT. How can I pass this value to a time variable. I understand that the type for a time variable is long, but what is the format in which I should write "today 8:34 am GMT" ?

public long time_stamp = ????


Thank you very much in advance!


 
 Post subject: Re: how to draw vertical lines in a strategy Post rating: 0   New post Posted: Mon 08 Aug, 2011, 07:23 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Java works with dates as long values, string values are just various representations. See:
https://www.dukascopy.com/wiki/index.php ... _Date/Time
See VLINE type at:
https://www.dukascopy.com/wiki/index.php?title=IChart


 
 Post subject: Re: how to draw vertical lines in a strategy Post rating: 0   New post Posted: Wed 17 Aug, 2011, 12:11 
User avatar

User rating: 1
Joined: Wed 06 Jul, 2011, 23:12
Posts: 42
Location: Romania, Bucharest
Thank you for your replay!


Still, I don't understand how can I pass a specific date and time value to the method that creates a vertical line .... For instance, in the example below got from the link you have offered, how can I replace the "tick.getTime()" with a specific date and time (for example if I want the vertical line draw at "16 august 2011, 10:15:00 am GMT"


double price1 = (tick.getAsk() + tick.getBid()) / 2;
IVerticalLineChartObject vLine = chart.getChartObjectFactory().createVerticalLine("vLine",
tick.getTime(), price1
);
chart.addToMainChart(vLine);


Thank you very much in advance!


 
 Post subject: Re: how to draw vertical lines in a strategy Post rating: 0   New post Posted: Wed 17 Aug, 2011, 13:04 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
iulian wrote:
how can I pass a specific date and time value to the method that creates a vertical line
Please see the following example strategy how to set specific date and time values:
viewtopic.php?f=65&t=42103&p=53616#p53616


 
 Post subject: Re: how to draw vertical lines in a strategy Post rating: 0   New post Posted: Wed 17 Aug, 2011, 13:47 
User avatar

User rating: 1
Joined: Wed 06 Jul, 2011, 23:12
Posts: 42
Location: Romania, Bucharest
Thank you!

My problem is now solved :)


 

Jump to:  

cron
  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com