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.

Multiple horizontal lines
 Post subject: Multiple horizontal lines Post rating: 0   New post Posted: Thu 23 Nov, 2017, 07:14 
User avatar

User rating: 0
Joined: Thu 23 Jan, 2014, 21:43
Posts: 17
Location: Peru, La Perla
Im trying to create an indicator that draws X horizontal lines each Y steps. For now im hardcoding the X and Y amounts but its not working well. I'm using a For statement but on each "for" the indicator re-draw the horizontal line, it uses the same object and put in the new position. I think i need an array of IHorizontalLineChartObject but dont know how to do it. Thanks


double decimales = 1.7;
for(int i = 1; i <= 8; i = i +1)
{
decimales=decimales+ 0.01;
IHorizontalLineChartObject zLine = factory.createHorizontalLine("zLine", decimales);
zLine.setLineStyle(LineStyle.SOLID);
zLine.setColor(Color.RED);
chart.add(zLine);
}


 
 Post subject: Re: Multiple horizontal lines Post rating: 0   New post Posted: Thu 23 Nov, 2017, 11:55 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Each chart object must have unique key.
int nr = 0;
factory.createHorizontalLine("zLine" + (nr++), decimales);


 

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