Need help - cTrader engine for backdating configuration OR why do even well known classical strategies fall apart on cTrader?

Question for you guys — why do even well-known classical strategies fall apart on cTrader?

I've been trying to test standard classical strategies on cTrader because I can't build anything that actually works. I went down the path of implementing well-known, already-tested, old-school strategies

Like the Connors "Double 7s" strategy (buy when SPY closes at a 7 day low while above the 200-day MA, sell at a 7 day high)- and I'm still getting very bad results. I don't get it.

What is it about the engine that seems to break even simple stuff that's supposed to work? If I do it manually on TradingView, I get noticeably better results.

I don't understand the whole thing here. its ANNOYING AS F***

What are the caveats or things I need to know in order to structure properly working strategies in cTrader?

Because honestly, it feels like the engine's calculations or the data are skewed or something — I don't even know how to describe it. I don't know where to start, but I've tried simple stuff and it's not working.

Any insight would be appreciated.

So this taken in US500 ok ? same same should be smooth as slik easy peasy ?

well NOT.. i get -7% eventually --- sooo .. annoying

any how this is just a "BASIC" concept startegy nothing facny im just .. tying to make a point here

so a-... help up a brother 🎯

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;


namespace cAlgo.Robots
{
    public enum RiskMode { FixedLots, RiskPercent }


    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class Connors7Down7UpBot : Robot
    {
        [Parameter("Consecutive Bars", Group = "Connors Setup", DefaultValue = 7, MinValue = 2)]
        public int ConsecutiveBars { get; set; }


        [Parameter("Use Exit SMA", Group = "Exit Rules", DefaultValue = true)]
        public bool UseExitSma { get; set; }


        [Parameter("Exit SMA Period", Group = "Exit Rules", DefaultValue = 5, MinValue = 1)]
        public int ExitSmaPeriod { get; set; }


        [Parameter("Use 200 Trend Filter", Group = "Trend Filter", DefaultValue = false)]
        public bool UseTrendFilter { get; set; }


        [Parameter("Trend SMA Period", Group = "Trend Filter", DefaultValue = 200, MinValue = 10)]
        public int TrendSmaPeriod { get; set; }


        [Parameter("Risk Mode", Group = "Risk Management", DefaultValue = RiskMode.RiskPercent)]
        public RiskMode AccountRiskMode { get; set; }


        [Parameter("Risk Percent (%)", Group = "Risk Management", DefaultValue = 1.0, MinValue = 0.1)]
        public double RiskPercent { get; set; }


        [Parameter("Fixed Lots", Group = "Risk Management", DefaultValue = 0.1, MinValue = 0.01)]
        public double FixedLots { get; set; }


        [Parameter("Stop Loss (Pips)", Group = "Risk Management", DefaultValue = 50.0, MinValue = 0.0)]
        public double StopLossPips { get; set; }


        [Parameter("Take Profit (Pips)", Group = "Risk Management", DefaultValue = 100.0, MinValue = 0.0)]
        public double TakeProfitPips { get; set; }


        private SimpleMovingAverage _exitSma;
        private SimpleMovingAverage _trendSma;
        private const string Label = "Connors7Down7Up";


        protected override void OnStart()
        {
            _exitSma = Indicators.SimpleMovingAverage(Bars.ClosePrices, ExitSmaPeriod);
            _trendSma = Indicators.SimpleMovingAverage(Bars.ClosePrices, TrendSmaPeriod);
        }


        protected override void OnBar()
        {
            ManageExits();
            CheckEntries();
        }


        private void CheckEntries()
        {
            if (HasActivePosition()) return;


            bool is7Down = IsConsecutiveDown(ConsecutiveBars);
            bool is7Up = IsConsecutiveUp(ConsecutiveBars);


            double lastClose = Bars.ClosePrices.Last(1);


            // Buy Setup: Mean reversion bounce after 7 consecutive down closes
            if (is7Down)
            {
                if (UseTrendFilter && lastClose < _trendSma.Result.Last(1))
                    return;


                double volume = CalculateVolume(StopLossPips);
                ExecuteMarketOrder(TradeType.Buy, SymbolName, volume, Label, 
                    StopLossPips > 0 ? StopLossPips : (double?)null, 
                    TakeProfitPips > 0 ? TakeProfitPips : (double?)null);
            }
            // Sell Setup: Mean reversion pull-back after 7 consecutive up closes
            else if (is7Up)
            {
                if (UseTrendFilter && lastClose > _trendSma.Result.Last(1))
                    return;


                double volume = CalculateVolume(StopLossPips);
                ExecuteMarketOrder(TradeType.Sell, SymbolName, volume, Label, 
                    StopLossPips > 0 ? StopLossPips : (double?)null, 
                    TakeProfitPips > 0 ? TakeProfitPips : (double?)null);
            }
        }


        private void ManageExits()
        {
            if (!UseExitSma) return;


            double lastClose = Bars.ClosePrices.Last(1);
            double smaValue = _exitSma.Result.Last(1);


            foreach (var position in Positions.FindAll(Label, SymbolName))
            {
                // Exit Long when price closes above 5-period SMA
                if (position.TradeType == TradeType.Buy && lastClose > smaValue)
                {
                    ClosePosition(position);
                }
                // Exit Short when price closes below 5-period SMA
                else if (position.TradeType == TradeType.Sell && lastClose < smaValue)
                {
                    ClosePosition(position);
                }
            }
        }


        private bool IsConsecutiveDown(int count)
        {
            for (int i = 1; i <= count; i++)
            {
                if (Bars.ClosePrices.Last(i) >= Bars.ClosePrices.Last(i + 1))
                    return false;
            }
            return true;
        }


        private bool IsConsecutiveUp(int count)
        {
            for (int i = 1; i <= count; i++)
            {
                if (Bars.ClosePrices.Last(i) <= Bars.ClosePrices.Last(i + 1))
                    return false;
            }
            return true;
        }


        private double CalculateVolume(double slPips)
        {
            if (AccountRiskMode == RiskMode.FixedLots)
            {
                double targetUnits = FixedLots * Symbol.LotSize;
                return Symbol.NormalizeVolumeInUnits(targetUnits, RoundingMode.ToNearest);
            }


            double riskPips = slPips > 0 ? slPips : 50.0;
            double riskAmount = Account.Equity * (RiskPercent / 100.0);
            double riskPerPip = riskAmount / riskPips;
            double rawVolume = riskPerPip / Symbol.PipValue;


            return Symbol.NormalizeVolumeInUnits(rawVolume, RoundingMode.ToNearest);
        }


        private bool HasActivePosition()
        {
            return Positions.Any(p => p.Label == Label && p.SymbolName == SymbolName);
        }
    }
}
reddit.com
u/Leo6-2 — 11 days ago
▲ 1 r/FullStack+1 crossposts

Architecting data question / help /advice needed. How to achieve instant UI responsiveness with local data?

Hey Gang 💵

i’m building a local data exploration web app using HTML/CSS/JS, a Python backend, and DuckDB with Parquet/CSV files. Despite having strong hardware, my local app runs slowly, whereas similar web apps online... even those using heavier frameworks like React / React router load and respond almost instantly. AI tools suggested basic caching or heavier frameworks like Django, but didn't solve the core performance bottleneck.

Coming from a frontend/design background, I haven't worked with high-performance data processing before. How do faster web apps structure their architecture to handle heavy calculations and render data so quickly?

Because from my experience with AI they are smart Tools but I'm not sure they're giving you the best solution every time so this time is well I'm doubting that I can get a solution from AI so I wonder what would you people here that knowledgeable and have a lot of experience would suggest ​​.

reddit.com
u/Leo6-2 — 11 days ago
▲ 4 r/LETFs+1 crossposts

an FYI - QuantConnect Seems TO CLAULCATE INDICATOR/S differently !

* Long story short - been fucking around with a leveraged-ETF rotation strategy for the last few days.*

The strategy holds one leveraged ETF at a time, flipping between positions when RSI hits hard thresholds - for example:

RSI_SPY > 80 → rotate into UVXY.

The strategy produced 186 trades in my standalone Python replica.

QuantConnect?

136 trades.

Both Cloud and local LEAN.

Same strategy.

Same period.

Same data.

So I started digging.

It wasn't the data.

It wasn't the margin model.

It wasn't the strategy logic.

It was RSI.

More specifically, a subtle difference in how QuantConnect seeds Wilder's RSI compared with the formula used in my Python implementation.

And because the strategy uses hard thresholds, that tiny difference was enough to fuck everything up.

A day where my RSI was 80.1 could be 79.8 in QuantConnect.

That's enough to miss the rotation.

Then the next position is different.

Then the next signal is different.

And suddenly the entire trade sequence is out of sync.

What made this especially annoying was that the numbers weren't wildly wrong. They were close enough to look completely normal.

The final way I isolated it was to calculate the RSI by hand using QuantConnect's own stored price data, then compare that against the RSI QuantConnect was reporting.

That's where the difference finally showed up.

The fix was to stop using QuantConnect's built-in RSI and implement the Wilder calculation manually.

After that:

>!TADA - (=^ェ^=)!<

Python: 186

QuantConnect: 186

Debugging took around 16 hours across the data audit, margin investigation and asking AI wHaT the Shit is this - and bam ----> indicator forensics.

>All that because *“Wilder's RSI”* apparently doesn't necessarily mean the same fucking thing everywhere.

Lesson learned:

If you're trying to get multiple backtesting engines to produce the same result, don't just compare the strategy logic. Compare the actual numbers coming out of every indicator.

reddit.com
u/Leo6-2 — 2 months ago
▲ 4 r/GoogleAdsDiscussion+1 crossposts

WHAT is the most reliable / realistic way for tracking for a Google Ads and WooCommerce combination ?

I got my WooCommerce *WORDPRESS* obviously and I'm promoting stuff using GOOGLE ADS - PURCHASE EVENT / conversions -
BUT
I am not a fan of the current counting method.

It feels like I am spending a money based on conversion data that often feels like a vanity metric rather actual sales. or purchase events IF YOU WILL

I want to KNOW - that ok this month we had this much REAL CONVERISONS not some results being reported are realistic and accurate but actually i got no idea if thats true or google does some BS statistics

Could you SHARE HOW you do that specific tracking methods for your own business ?

T H A N K
Y O U
G U Y S

reddit.com
u/Leo6-2 — 5 months ago