Hi, is there any way possible if we can use Python API to deploy our setup. e.g. if I use 9 ema and 21 ema and I want to place a long order at crossover and a short order for crossunder. So I want to scan all charts using same code and get a list where this crossover or crossunder is true. This is just an example. So is there any possibility we can code this with API, or we can only get price details, place order etc using APIs. Thanks.
Yes of course it helps too much
Yes, you can do it. You can calculate EMI using OHLC data.
I think you will have to keep running a scan with every incoming candle. If close > ema (last n candles) then do something. you can do this easily for any symbol.
this might also be possible in tradingview. TV has feature of alerts - so everytime an alert is generated you can execute an order via webhook. Here is a tutorial on this: Tutorial:Trading View Automation on Delta Exchange : Delta Exchange India
Hi , You can use delta api to get OHLC data (v2/history/candles) and compute EMA values and identify crossovers/crossunder conditions. You can loop through all available symbols and place orders (v2/orders) when conditions are met. Then continuously monitor open orders/positions to modify /cancel orders as needed.
To build a screener you will have to define multiple symbols (example: btc, eth, xrp). To do this you can either fetch all available symbols from the api or manually define a list of high volume pairs that you like. Make sure you are using the same time frame (1m,5m,1h…etc.) across all symbols.
Here is a function for the scanner for inspiration, you can see the flow and rewrite it according to your strategy. for the code below write standard etect_ema_signals(df) fucntion and fetch_ohlc(symbol) fucntions,
def scan_market():
buy_signals = []
sell_signals = []
for symbol in SYMBOLS:
df = fetch_ohlc(symbol)
if df is None:
print(f" No data for {symbol}")
continue
signal = detect_ema_signals(df)
if signal == 1:
buy_signals.append(symbol)
elif signal == -1:
sell_signals.append(symbol)
print("\nBuy Signals:", buy_signals)
print(" Sell Signals:", sell_signals)
scan_market()