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.

"Thrustbar" indicator
 Post subject: "Thrustbar" indicator Post rating: 0   New post Posted: Wed 06 May, 2015, 13:28 
User avatar

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


 
 Post subject: Re: "Thrustbar" indicator Post rating: 0   New post Posted: Thu 07 May, 2015, 11:26 
User avatar

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


 
 Post subject: Re: "Thrustbar" indicator Post rating: 0   New post Posted: Thu 07 May, 2015, 11:50 
User avatar

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;


 
 Post subject: Re: "Thrustbar" indicator Post rating: 0   New post Posted: Thu 07 May, 2015, 13:41 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
In this thread we give only advice on programming.
For for trading analysis advice visit:
https://www.dukascopy.com/fxcomm/
https://www.youtube.com/playlist?list=P ... sC4KfDHFy8


 
 Post subject: Re: "Thrustbar" indicator Post rating: 0   New post Posted: Thu 07 May, 2015, 14:21 
User avatar

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 ?


 
 Post subject: Re: "Thrustbar" indicator Post rating: 0   New post Posted: Fri 08 May, 2015, 07:36 
User avatar

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.


 
 Post subject: Re: "Thrustbar" indicator Post rating: 0   New post Posted: Fri 08 May, 2015, 09:15 
User avatar

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


 

Jump to:  

cron
  © 1998-2024 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