iCUSTOM and Period Conversion

 

Hello all....

I know there has been a lot of discusion regarding CUSTOM TIME FRAMES... I've used the Period Converter and for the most part have been satisfied.

That said, here's my question....

My EA is running in the 1HR chart... and I want to run a custom indicator against a custom chart.... in looking at the syntax for the iCustom fuction, it appears to me that I can only use standard default MT4 charts... is this true? How do I point iCustom to my CUSTOM chart, what would the syntax be?

Thank you for your help!

 
7979 wrote >>

Hello all....

I know there has been a lot of discusion regarding CUSTOM TIME FRAMES... I've used the Period Converter and for the most part have been satisfied.

That said, here's my question....

My EA is running in the 1HR chart... and I want to run a custom indicator against a custom chart.... in looking at the syntax for the iCustom fuction, it appears to me that I can only use standard default MT4 charts... is this true? How do I point iCustom to my CUSTOM chart, what would the syntax be?

Thank you for your help!

Reposted for a response...

 
7979:

Reposted for a response...

The following may well be wrong, but it may well also be the only answer you're going to get over the Easter weekend. Might be useful to read this in conjunction with 'modify time frame - how to ?'


As far as I'm aware, you can use period_converter to generate custom time periods, you can view this aggregated bar data on an offline chart, and you can add any custom indicator to an offline chart. If you have your own indicator which calls another indicator using iCustom, then it will probably work fine on an offline chart by passing 0 for the timeframe parameter of iCustom.


However, you can't run an EA on anything other than a live chart, and a live chart has to use one of MetaTrader's standard time periods rather than a custom one. You can add the EA to an offline chart, but it will never receive any ticks and start() will never get called. The only exception - and it's a weird one - is that you can right-click and turn off the "Offline chart" property, but what you then seem to have is a chart which receives ticks but does not build any new bars. Time[0], Open[0] etc forever continue to refer to the last of the offline bars, rather than having MetaTrader calculate new bars in real-time for your bespoke period.


The only way that I'm aware of to run an EA on a bespoke time period is to build the bespoke bars in memory. However, as far as I'm aware, there's no way to pass this bespoke bar data to an indicator and say to it, "Calculate your signals from this". You have to replicate the indicator calculation in the EA (and rewrite it to use your bespoke bar data rather than native MetaTrader data).


In 'modify time frame - how to ?' Irtron refers to "a technique that allows [an EA] to run on a non-standard time frame". From context, this must be a technique other than the one I'm describing because he refers to my response as "not entirely accurate". However, he hasn't shared the details of this technique.

 
jjc wrote >>

... If you have your own indicator which calls another indicator using iCustom, then it will probably work fine on an offline chart by passing 0 for the timeframe parameter of iCustom.

jjc, thank you for your response... I think you're right that this will have to be done in memory...

-c

 
7979:

jjc, thank you for your response... I think you're right that this will have to be done in memory...

-c


7979, were you ever able to figure out how to use an unnatural timeframe actively with iCustom on a standard chart? How is this done "in memory?" I'm creating a multi-time frame indicator very similar to FerruFX's (attached), but am using only custom indicators and want to include the H2 timeframe. I've referenced the Period_120, which exists as xxxxxx120.hst for all my pairs from periodconverter, but it's not recognized in the code.


Thanks in advance.



Files:
Reason: