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.

Drawing local highs and lows on a chart using SAR indicator
 Post subject: Drawing local highs and lows on a chart using SAR indicator Post rating: 0   New post Posted: Mon 04 Jun, 2012, 16:54 

User rating: 1
Joined: Tue 12 Jul, 2011, 20:43
Posts: 51
Location: Germany,
Hi support,

I created a custom SAR indicator and I want to use it to mark local highs and lows on the chart to better visualize trends (according to dow theory: higher highs and higher lows indicates an uptrend, lower highs and lower lows indicates a downtrend) and also as a feedback for the correct parameterization of my SAR indicator (are the highs and lows which I see plausible or have I to increase / decrease SAR parameters ?).

Concretely I want to realize this as follows:
Every time when the reverse line changes from bottom to top, I have to found the period with the highest high which occured during the time span from previous SAR change (from top to bottom) until last period, and then I want to draw a green letter "H" - or alternatively a green graphical object like a down arrow - above this candle.
Conversely, every time when the reverse line changes from top to bottom, I have to found the period with the lowest low which occured during the time span from previous SAR change (from bottom to top) until last period, and then I want to draw a red letter "L" - or alternatively a red graphical object like an up arrow - below this candle.

Can you please provide an example using a built-in SAR indicator (e.g. Parabolic SAR) which shows how to realize this, especially how to draw the graphical objects on the chart ?

Thanks in advance and regards
AbsoluteReturner


 
 Post subject: Re: Drawing local highs and lows on a chart using SAR indicator Post rating: 0   New post Posted: Tue 05 Jun, 2012, 12:39 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
https://www.dukascopy.com/wiki/#Historical_high_values/High_and_low_with_supplement_lines
Instead of iterating over bars, iterate over the result array of the indicator.
For calculating your SAR by candle see universal approach here (beforehand you need to register the indicator):
https://www.dukascopy.com/wiki/#Indicator_Calculation/Calculate_indicator_by_candle_interval
For adding text on chart see TEXT in:
https://www.dukascopy.com/wiki/#Chart_object_catalog

You can also draw text on chart right away from your indicator, see TD_Sequential.java indicator as an example.


 
 Post subject: Re: Drawing local highs and lows on a chart using SAR indicator Post rating: 0   New post Posted: Tue 05 Jun, 2012, 13:07 

User rating: 1
Joined: Tue 12 Jul, 2011, 20:43
Posts: 51
Location: Germany,
API Support wrote:
For adding text on chart see TEXT in:
https://www.dukascopy.com/wiki/#Chart_object_catalog

You can also draw text on chart right away from your indicator, see TD_Sequential.java indicator as an example.


I assume that "Chart object catalog" is available in strategies only, not for indicators.
Therfore I need the link to the "TD_Sequential.java" indicator source example, I didn't found it in the forum with the search function.


 
 Post subject: Re: Drawing local highs and lows on a chart using SAR indicator Post rating: 0   New post Posted: Tue 05 Jun, 2012, 13:11 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See:
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