|
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.
"Thrustbar" indicator |
Magic_FX
|
Post subject: "Thrustbar" indicator |
Post rating: 0
|
Posted: Wed 06 May, 2015, 13:28
|
|
User rating: 1
Joined: Sat 27 Jul, 2013, 16:42 Posts: 17 Location: Russian Federation, Saint-Petersburg
|
hello support. I would like use this indicator: "THRUSTBAR" You can show me, how use in code?
Green Bar buy Red bar Sell
Thank you
|
|
|
|
|
API Support
|
Post subject: Re: "Thrustbar" indicator |
Post rating: 0
|
Posted: Thu 07 May, 2015, 11:26
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
public void testIndicator() throws JFException { long currBarTime = history.getBar(Instrument.EURUSD, Period.ONE_MIN, OfferSide.ASK, 0).getTime(); Object[] thrustbar = indicators.calculateIndicator( Instrument.EURUSD, Period.ONE_MIN, new OfferSide[] {OfferSide.ASK}, "THRUSTBAR", new AppliedPrice[] {AppliedPrice.CLOSE}, new Object[] {5}, Filter.NO_FILTER, 3, currBarTime, 0); int[] bullishArr = (int[]) thrustbar[0]; int[] bearishArr = (int[]) thrustbar[1]; console.getOut().println( toStr(bullishArr) ); console.getOut().println( toStr(bearishArr) ); } public static String toStr(int[] arr) { String str = ""; for (int r = 0; r < arr.length; r++) { str += "[" + r + "] " +arr[r] + "; "; } return str; }
Also please see https://www.dukascopy.com/wiki/#Indicat ... e_interval
|
|
|
|
|
Magic_FX
|
Post subject: Re: "Thrustbar" indicator |
Post rating: 0
|
Posted: Thu 07 May, 2015, 11:50
|
|
User rating: 1
Joined: Sat 27 Jul, 2013, 16:42 Posts: 17 Location: Russian Federation, Saint-Petersburg
|
big thanks.
and, how to have signal ?
ex:
if ( bullishArr ==1 ){ buy = true;
if ( bearishArr == 1){ sell = true;
|
|
|
|
|
API Support
|
Post subject: Re: "Thrustbar" indicator |
Post rating: 0
|
Posted: Thu 07 May, 2015, 13:41
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
|
|
|
|
Magic_FX
|
Post subject: Re: "Thrustbar" indicator |
Post rating: 0
|
Posted: Thu 07 May, 2015, 14:21
|
|
User rating: 1
Joined: Sat 27 Jul, 2013, 16:42 Posts: 17 Location: Russian Federation, Saint-Petersburg
|
Thanks support for reply.
You think , I asked analysis advice? I think , that me need advice on programming.
I would like just receive a signal for the indicator. how to get the right signal for Red / Green Bars ?
|
|
|
|
|
API Support
|
Post subject: Re: "Thrustbar" indicator |
Post rating: 0
|
Posted: Fri 08 May, 2015, 07:36
|
|
User rating: ∞
Joined: Fri 31 Aug, 2007, 09:17 Posts: 6139
|
Bullish signal is represented by 1 in thrustbar[0] array. Bearish - by 1 in thrustbar[1] array.
|
|
|
|
|
Magic_FX
|
Post subject: Re: "Thrustbar" indicator |
Post rating: 0
|
Posted: Fri 08 May, 2015, 09:15
|
|
User rating: 1
Joined: Sat 27 Jul, 2013, 16:42 Posts: 17 Location: Russian Federation, Saint-Petersburg
|
big thanks support! ))
but: how write bull and Bear signals in the code for open position? I think it is not correct: ? if ( bullishArr ==1 ){ buy = true; if ( bearishArr == 1){ sell = true;
I need your help in order to correctly call each signal.
Thanks
|
|
|
|
|
|
Pages: [
1
]
|
|
|
|
|