Help for " result"

Created at 13 May 2024, 12:18
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!
OB

obus79

Joined 03.02.2023

Help for " result"
13 May 2024, 12:18


HI! I inserted a custom indicator in this part of code...How can I correct it by correctly inserting the "result" value?

 

 

Bars bars_l = MarketData.GetBars(TimeFrame.Minute15);
            if (bars_l == null)
                PrintErrorAndStop("INVALID_SYMBOL");

            var sMAfast_l = Indicators.GetIndicator<SMAfast>(bars_l.ClosePrices, A_1mwdie5);
            var sMAslow_r = Indicators.GetIndicator<SMAslow>(Bars.ClosePrices, A_svpg4c);
            int crossPeriod = new[] { 0, 1 }.Max();
            bool result = sMAfast_l.HasCrossedBelow(sMAslow_r, crossPeriod);

            if (result)
            {
                return sMAfast_l.Last(1) < sMAslow_r.LastValue;
            }
            else
            {
                return false;
            }


@obus79
Replies

PanagiotisCharalampous
14 May 2024, 05:29

Hi there,

Your question is not clear. Please explain what you think is wrong and how you would like it to be corrected.

Best regards,

Panagiotis


@PanagiotisCharalampous

obus79
14 May 2024, 09:09 ( Updated at: 15 May 2024, 05:17 )

RE: Help for " result"

PanagiotisCharalampous said: 

Hi there,

Your question is not clear. Please explain what you think is wrong and how you would like it to be corrected.

Best regards,

Panagiotis

hi, the code written as follows is not correct and I don't understand how to fix it. I used " Indicator.GetIndicator<> " as it is a custom indicator. I removed ".Result " but I need to manage the value of Result somewhere...


@obus79

PanagiotisCharalampous
15 May 2024, 05:21

RE: RE: Help for " result"

obus79 said: 

PanagiotisCharalampous said: 

Hi there,

Your question is not clear. Please explain what you think is wrong and how you would like it to be corrected.

Best regards,

Panagiotis

hi, the code written as follows is not correct and I don't understand how to fix it. I used " Indicator.GetIndicator<> " as it is a custom indicator. I removed ".Result " but I need to manage the value of Result somewhere...

Does the indicator have a Result property? Can you share the indicator's source code?


@PanagiotisCharalampous