Requisitos Previos
Antes de empezar, necesitas:
Entorno de Desarrollo
Python 3.8+ o Node.js 16+ instalado
Paso 1: Instalar Dependencias
Paso 2: Obtener Datos de Mercado
Primero, obtengamos las barras OHLC del par que quieres analizar:
import requests
API_KEY = "tu_api_key_aqui"
BASE_URL = "https://api.innova-trading.com"
# Obtener ultimas 100 barras de EURUSD en H1
response = requests.get(
f " { BASE_URL } /api/external/bars/EURUSD/60" ,
params = { "limit" : 100 },
headers = { "Authorization" : f "Bearer { API_KEY } " }
)
barras = response.json()[ "bars" ]
print ( f "Obtenidas { len (barras) } barras" )
print ( f "Ultima barra: { barras[ - 1 ] } " )
La respuesta incluye:
{
"bars" : [
{
"time" : 1765540800 ,
"open" : 1.0920 ,
"high" : 1.0950 ,
"low" : 1.0900 ,
"close" : 1.0935 ,
"volume" : 15000
}
]
}
Paso 3: Crear una Senal
Ahora creemos una senal de COMPRA simple:
# Obtener la ultima barra
ultima_barra = barras[ - 1 ]
# Crear senal de COMPRA
senal = {
"symbol" : "EURUSD" ,
"timeframe" : 60 ,
"indicator_name" : "Mi Primera Senal" ,
"points" : [
{
"time" : ultima_barra[ "time" ], # IMPORTANTE: usar el time de la barra
"type" : "low" , # Debajo de la vela
"price" : ultima_barra[ "low" ] - 0.0005 , # Un poco debajo del minimo
"label" : "COMPRA" ,
"color" : "#3b82f6" , # Azul
"shape" : "arrowUp" ,
"size" : 2
}
]
}
Paso 4: Enviar a InnovaTrading
response = requests.post(
f " { BASE_URL } /api/external/indicators/mi_primera_senal" ,
json = senal,
headers = {
"Authorization" : f "Bearer { API_KEY } " ,
"Content-Type" : "application/json"
}
)
resultado = response.json()
print ( f "Exito! Puntos enviados: { resultado[ 'points_received' ] } " )
print ( f "Expira en: { resultado[ 'expires_at' ] } " )
Paso 5: Ver en el Chart
Abre InnovaTrading en tu navegador
Ve al chart de EURUSD en timeframe H1
Abre el panel de Indicadores Externos
Tu indicador “Mi Primera Senal” deberia aparecer
Activa el toggle para verlo en el chart
Felicidades! Has creado tu primer indicador externo.
Codigo Completo
import requests
API_KEY = "tu_api_key_aqui"
BASE_URL = "https://api.innova-trading.com"
headers = { "Authorization" : f "Bearer { API_KEY } " }
# 1. Obtener barras
response = requests.get(
f " { BASE_URL } /api/external/bars/EURUSD/60" ,
params = { "limit" : 100 },
headers = headers
)
barras = response.json()[ "bars" ]
# 2. Crear senal
ultima_barra = barras[ - 1 ]
senal = {
"symbol" : "EURUSD" ,
"timeframe" : 60 ,
"indicator_name" : "Mi Primera Senal" ,
"points" : [
{
"time" : ultima_barra[ "time" ],
"type" : "low" ,
"price" : ultima_barra[ "low" ] - 0.0005 ,
"label" : "COMPRA" ,
"color" : "#3b82f6" ,
"shape" : "arrowUp" ,
"size" : 2
}
]
}
# 3. Enviar
response = requests.post(
f " { BASE_URL } /api/external/indicators/mi_primera_senal" ,
json = senal,
headers = { ** headers, "Content-Type" : "application/json" }
)
print (response.json())
Siguientes Pasos
Formato de Senales Aprende a crear senales con Entry, SL y TPs
Tu Primer Indicador Tutorial completo: MA Crossover