I am courious how to you guys store the logic (the algorithm) of you strategies.
Prior I have written the logic directly into the source code of the program. But why not use a common format like JSON to store the logic. That way you can share development with other developers without giving away your valuable secrets and IP.
The logic can be loaded into backtesting or live trading engine for execution.
Multiple strategies can be traded at the same time with different allocations.
What do you think about using JSON or XML for this?
Example of a EMA crossover system with fixed 6% profit target and fixed 2% SL:
Prior I have written the logic directly into the source code of the program. But why not use a common format like JSON to store the logic. That way you can share development with other developers without giving away your valuable secrets and IP.
The logic can be loaded into backtesting or live trading engine for execution.
Multiple strategies can be traded at the same time with different allocations.
What do you think about using JSON or XML for this?
Example of a EMA crossover system with fixed 6% profit target and fixed 2% SL:
Code:
{
"strategy_name": "EMA 20 Crossover 1",
"instrument": "SPY",
"timeframe": "5 minutes",
"signal": {
"long": {
"entry": "price > ema(20)",
"exit": "price >= entry * 1.06 || price <= entry * (1-0.02)"
},
"short": {
"entry": "price < ema(20)",
"exit": "price <= entry * (1-0.06) || price >= entry * 1.02"
}
}
}