# Get the latest bar
latest_bar = bars[-1]
bar_time = latest_bar["time"] # IMPORTANT: Use this timestamp!
entry_price = latest_bar["close"]
# Calculate levels
stop_loss = entry_price - 0.0030 # 30 pips
tp1 = entry_price + 0.0030 # 1:1 RR
tp2 = entry_price + 0.0060 # 1:2 RR
tp3 = entry_price + 0.0090 # 1:3 RR
# Create signal with multiple points
signal = {
"symbol": "EURUSD",
"timeframe": 60,
"indicator_name": "My First Signal",
"points": [
{
"time": bar_time,
"type": "low",
"price": entry_price,
"label": "BUY",
"color": "#3b82f6",
"shape": "arrowUp",
"size": 2
},
{
"time": bar_time,
"type": "low",
"price": stop_loss,
"label": "SL",
"color": "#ef4444",
"shape": "square",
"size": 1
},
{
"time": bar_time,
"type": "high",
"price": tp1,
"label": "TP1",
"color": "#22c55e",
"shape": "circle",
"size": 1
},
{
"time": bar_time,
"type": "high",
"price": tp2,
"label": "TP2",
"color": "#22c55e",
"shape": "circle",
"size": 1
},
{
"time": bar_time,
"type": "high",
"price": tp3,
"label": "TP3",
"color": "#22c55e",
"shape": "circle",
"size": 1
}
],
"metadata": {
"signal_type": "BUY",
"strategy": "Quick Start Example"
}
}
# Submit the signal
response = requests.post(
f"{BASE_URL}/api/external/indicators/my_first_signal",
json=signal,
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
)
result = response.json()
print(f"Signal submitted! {result['points_received']} points")
print(f"Expires at: {result['expires_at']}")