This guide will help you understand how the Strategy Editor works in Buddy Trading. Think of it as a tool that lets you create automated trading strategies without needing to write complex code. Here’s a breakdown of how it works:
Handlers are like "event listeners" that respond to specific moments in your trading strategy. For example, when a new price update happens or when a trade position is opened or closed. Here’s a list of the main handlers:
Each handler is like a small program that decides what to do when something happens in the market.
Every handler receives two pieces of information:
Here’s an example of what happens inside a handler:
async (state = {}, update = {}) => {
const { mts, price, candle } = update; // Get the latest data
return state; // Update the state if needed
}