import a custom indicator in multi time frame

Created at 04 Aug 2024, 14:12
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
YA

yaghouti

Joined 19.12.2019

import a custom indicator in multi time frame
04 Aug 2024, 14:12


hi

i have a custom indicator name HSNind; this indicator do not get any parameters. i want to nest this indicator in a new indicator but in multitimeframe.

in same time frame it works properly but when i want to use in another time frime it shows nothing

the code for multitime frame is like this:

 private HSNind HSN;

protected override void Initialize()
        {
            HSN= Indicators.GetIndicator<HSNind>(TimeFrame.Range3);

}

public override void Calculate(int index)
        {
           
            F1line[index] = HSN.F1line[index];
        }

when i remove TimeFrame.Range3  from this code it works properly but in the same time frame,

how can i get the data of other timeframe?

 

 

 


@yaghouti
Replies

PanagiotisCharalampous
05 Aug 2024, 05:59

Hi there,

If the indicator does not take any parameters, then you cannot just pass a parameter and expect it to work. If you want to pass a timeframe parameter then you need to reprogram HSNind to accept a parameter and perform the relevant calculation.

Best regards,

Panagiotis


@PanagiotisCharalampous