stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

CurrencyExposureChart
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=5046
Page 1 of 1
Author:  renexxxx [ Fri Jan 13, 2017 1:28 am ]
Post subject:  CurrencyExposureChart

Remember the CurrencyExposure indicator? That indi displays the currency exposure for all the currently open trades.

Boulder (Aram) contacted me some time ago, with a request to create an indicator that would display the historical currency exposure, for all selected currencies, similar to how TradeChart2 displays the equity and balance lines.

The attached CurrencyExposureChart is a result of this request.
CurrencyExposureChart.PNG
It works like this:

(1) It collects all the trades (historical and currently open), that pass the MagicNumber, CommentFilter, SymbolFilter, CurrencyFilter and date selection criteria.

(2) Subsequently, it works out for each candle in the reporting period, which of these orders was/is open (or partially open) during that candle. Knowing which orders were open for each shift, it can then derive the currency exposure for that shift.

If there were many orders in the result set obtained in (1), and there are many candles in the reporting period, the workload for this indicator is huge ... and appears to hang Empty4. So, use the input parameters wisely to restrict the number selected orders and candles.

Empty4 limits the number of buffers in a custom indicator to 8. This limits the number of lines (i.e. currencies) the indicator can display. So, if you specify more than 8 currencies, it will only display the first 8.

Have fun.
Author:  arts [ Fri Jan 13, 2017 4:46 pm ]
Post subject:  CurrencyExposureChart

Hi Renexxxx,

Interesting indicator.

In fact you are no longer restricted to 8 buffers and haven't been for some time. I believe you can now have up to 512 although 29 is the most I've ever used...

Regards,

Arts
Author:  renexxxx [ Fri Jan 13, 2017 8:46 pm ]
Post subject:  CurrencyExposureChart

Oops, you're right, as demonstrated in this code.
Author:  SteveHopwood [ Sun Jan 15, 2017 11:57 am ]
Post subject:  CurrencyExposureChart

arts ยป Fri Jan 13, 2017 4:46 pm wrote:Hi Renexxxx,

Interesting indicator.

In fact you are no longer restricted to 8 buffers and haven't been for some time. I believe you can now have up to 512 although 29 is the most I've ever used...

Regards,

Arts
That is really handy info Arts. Thanks.

:xm:
All times are UTC Page 1 of 1