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.

Close position code
 Post subject: Close position code Post rating: 0   New post Posted: Thu 19 Jan, 2012, 07:59 

User rating: 0
Joined: Fri 25 Nov, 2011, 02:49
Posts: 17
Location: Malaysia,
Could you please show me the code ( if possible) to close a position if you get a hammer candle form if you are short within so many candles of entry .... i.e. if I my strategy had just gone short then the current candle closes or a candle with 4 candles closes as a hammer it exits position...

If the above is possible can you also show how if you are say long and a doji forms then the next candle close lower than the wick on the doji it closes position or opposite if short..



Thanks


 
 Post subject: Re: Close position code Post rating: 0   New post Posted: Mon 23 Jan, 2012, 18:48 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://www.dukascopy.com/wiki/#Candlest ... indicators


 
 Post subject: Re: Close position code Post rating: 0   New post Posted: Wed 06 Mar, 2013, 13:42 
User avatar

User rating: 0
Joined: Tue 28 Aug, 2012, 12:34
Posts: 10
Location: Spain, Barcelona
Hi,
I'm interested in to see the code of the function "cdlHammer".

/**
* Calculates the Hammer indicator for a bar specified with the <code>shift</code> parameter.
*
* @param instrument instrument of the bar
* @param period period of the bar
* @param side Bid or Ask side of the bar
* @param shift number of candles back in time staring from current bar. 0 - current bar (currently generated from ticks),
* 1 - previous bar (last formed bar), 2 - current bar minus 2 bars and so on
* @return value for the specified bar
* @throws JFException when parameters are not valid
* @see <a href = https://www.dukascopy.com/wiki/#Indicator_calculation>Indicator calculation</a>
*/
public int cdlHammer(Instrument instrument, Period period, OfferSide side, int shift) throws JFException;

Is possible to see the java class thats contains the implementation of the function?
I'm not able to forund the class from Eclipse.
Thanks!


 
 Post subject: Re: Close position code Post rating: 0   New post Posted: Wed 06 Mar, 2013, 13:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See the last sentence:
https://www.dukascopy.com/wiki/#Platform_indicator_source_files


 

Jump to:  

  © 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