Replies

jacopotrono
08 Jun 2023, 22:33

RE: RE:

Thank you firemist for your time and answer.

Could you show me an example applied to this code? 

 

using cAlgo.API;

namespace cAlgo
{
    [Indicator(IsOverlay = false)]
    public class RSIIndicator : Indicator
    {
        [Parameter("Source")]
        public DataSeries Source { get; set; }

        [Parameter("RSI Periods", DefaultValue = 14, MinValue = 1)]
        public int Periods { get; set; }

        [Output("RSI", Color = Colors.Green)]
        public IndicatorDataSeries RSI { get; set; }

        public override void Calculate(int index)
        {
            double avgUp = 0;
            double avgDown = 0;

            for (int i = index - Periods + 1; i <= index; i++)
            {
                double diff = Source[i] - Source[i - 1];

                if (diff > 0)
                    avgUp += diff;
                else
                    avgDown += diff;
            }

            avgUp /= Periods;
            avgDown /= Periods;

            double rsi = 100 - (100 / (1 + (avgUp / -avgDown)));

            RSI[index] = rsi;
        }
    }
}

@jacopotrono

jacopotrono
12 Mar 2023, 15:05

RE:

firemyst said:

The first question is -- do you want to do this all under the same cBot? Or across different cBots? The answer to that question will affect the way you architecture things (and thus performance), because cBots cannot communicate directly with each other.

 

If it's the former, one thing you could try is setting a static variable that maintains the count. You'd have to make updating that variable thread-safe.

 

Thanks for the reply,

I was thinking for a method focus on a single acting bot. I tried at first to assign a ticket for every trade with a check before every signal; but with high volatility the bot starts to lose control and to overlap trades


@jacopotrono

jacopotrono
12 Mar 2023, 15:01 ( Updated at: 27 Mar 2024, 23:42 )

RE:

firemyst said:

It's not very complex.

Doing a Google search, there's a similar one:

 

 

Perhaps you could contact that author to see if they'd be willing to do it for you.

If not, you should contact @PanagiotisChar

It would also help if you updated your post with the link to the original indicator on TradingView (assuming that's where you got it from since LazyBear is very active there)

Thanks for your reply firemyst,

i tried to write to the authos but He seems he is not so active recently


@jacopotrono