Forum Replies Created

Check out all your contributions and responses across the community.

Viewing 9 posts - 46 through 54 (of 54 total)
  • Author
    Posts
  • Yes, the rate limit varies from broker to broker (e.g.: Zeroth 3req/sec)

    This happens in almost every broker if we hit the API in the loop continuously.

    To solve this problem, you have to put the delay, if possible, of approx. 0.30 sec,

    also, we can do the batch fetching – hit the API in batch

    Below sample code you can refer:

    import time
    
    def fetch_all_data(symbols, fetch_func):
        data = {}
    
        for i, symbol in enumerate(symbols):
            try:
                data[symbol] = fetch_func(symbol)
                print(f"Fetched: {symbol}")
    
                # small delay to avoid rate limit
                time.sleep(0.5)
    
            except Exception as error:
                print(f"Failed: {symbol} -> {error}")
    
        return data
    
    # Sample
    def mock_fetch(symbol):
        return f"data_for_{symbol}"
    
    symbols = ["AAPL", "MSFT", "GOOG", "TSLA"]
    
    result = fetch_all_data(symbols, mock_fetch)
    
    print(result)

    Yes, so the solution that we provided in AlgoDelta is we can modify the order if the price changes.

    So, it’s like telling the exchange that “I want to buy up to this high price,” which effectively fills you instantly at the best available seller’s price, just like a Market order, but with a “safety cap.”. For more you can explore the more feature or contact support.

    You definitely do not need to manage 3 separate alerts. In our AlgoDelta platform, we have built a Grouping & Multiplier system specifically for this scenario.

    So clear solution in below steps:

    In the AlgoDelta dashboard, go to the “Group” section and add all 3 of your demat accounts into a single group

    Assign Multipliers: Set a multiplier for each account based on capital:

    Broker 1 : Multiplier 1 (Base) – Keep the base account in which have the less fund

    Broker 2 : Multiplier 2

    Broker 3 : Multiplier 3

    Single Webhook: Set up only one alert in TradingView pointing to your AlgoDelta Strategy Key.

    Even algoDelta fires orders to all 3 brokers at the same millisecond, so you get the same entry price across all accounts.

    Yes, every broker has their own “language” for symbols.

    In AlgoDelta, we solved this with our Universal Symbol Mapping engine. User don’t need to worry about tokens or specific broker formats anymore.

    User just have to select in which script they want to trade the symbol and token that we automatically managed by our platform AlgoDelta. You can explore more feature that automate your script trades.

    Yes, with AlgoDelta, you don’t have to worry about that. You can group accounts together, and once they’re grouped, a single action fires the order across all of them simultaneously.

    So instead of managing accounts one after another all orders go out almost at the same time you get consistent execution for everyone.

    In short, you just create a group and trade — the system takes care of syncing the execution.

    Yes, for sure we have this kind of the feature that is group management – so basically you can put all the different trades as you mension like Nifty and BankNifty into that group.

    Now you can set the combine target so no matter of the individual script if the combine profit reaches target then the both the position will be exited automatically. For more you can explore our app.

    Yes, we have the exactly the same feature that solves your problem even it can square off the trades in group also.

    So, we have the end time feature so for any trade you can set the end time (e.g. 3:00), so even if your Target or Stop Loss hasn’t been hit, AlgoDelta will force-exit the position at exactly 3:00 PM.

    Ans you can also set the start time – it’s like you are tell it to Start looking for entries only after a certain time (like 10:00 AM) to avoid morning volatility.

    Yes, so MACD is depending on many factors to be correct.

    So, to make it super accurate you need the right live candle data along with the sufficient historical data of that script.

    And may be sometimes the calculation mismatch is also there. Things to remember use the closed candles only, preload enough data (e.g. at least 200 candles) and maintain EMA continuity.

    Below is the code you can refer:

    def calculate_ema(prices, period):
        ema = []
        k = 2 / (period + 1)
    
        for i, price in enumerate(prices):
            if i == 0:
                ema.append(price)
            else:
                ema.append(price * k + ema[-1] * (1 - k))
    
        return ema
    
    def calculate_macd(prices):
        ema12 = calculate_ema(prices, 12)
        ema26 = calculate_ema(prices, 26)
    
        macd_line = [e12 - e26 for e12, e26 in zip(ema12, ema26)]
        signal_line = calculate_ema(macd_line, 9)
        histogram = [m - s for m, s in zip(macd_line, signal_line)]
    
        return macd_line, signal_line, histogram
    
    # Sample
    prices = [100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120]
    
    macd, signal, hist = calculate_macd(prices)
    
    print("MACD:", macd[-5:])
    print("Signal:", signal[-5:])
    print("Histogram:", hist[-5:])

    Supertrend depends on <strong data-start=”1096″ data-end=”1103″>ATR, and ATR needs historical candles.

    So, you have to pass both the historical and live data.

    Aggregate the data first and then pass in Supertrend function you will get the accurate value.
    Eg code below:

    def get_supertrend_input(symbol, live_candles):
        # Fetch historical 
        query = "GET HISTORICAL DATA"
        values = [symbol, "minute"]
        historical_candles = fetch_historical_data(query, values)
        # Merge
        all_candles = historical_candles + live_candles
        # Safety check
        if len(all_candles) < 15:  # minimum for ATR(10)
            return []
        return all_candles
    
    def run_supertrend(symbol, live_candles):
        candles = get_supertrend_input(symbol, live_candles)
        if not candles:
            return None
        result = compute_supertrend(candles, period=10, multiplier=3)
        if not result:
            return None
        return result[-1]  # latest signal
Viewing 9 posts - 46 through 54 (of 54 total)
×

Start a Discussion

Get help from the AlgoDelta community.

×

Welcome Back!

Enter your email to sign in or create an account. No passwords needed.

Pending Approval

⚠️

Delete This?

Are you sure you want to delete this? This action is permanent and cannot be undone.

Scroll to Top