public string Generate(MetaModel model) { StringBuilder code = new StringBuilder(); code.AppendLine("//Generated by Profit Robots strategy generator") .AppendLine("//http://profitrobots.com") .AppendLine("//@version=3") .AppendLine($"strategy(\"{model.Name}\", overlay = true, default_qty_type=strategy.percent_of_equity, default_qty_value=5)"); code.Append(ParametersFormatter.GenerateCode(model.Parameters)); code.Append(SourceFormatter.GenerateCode(model.Sources)); code.Append(ActionsFormatter.FormatActions(model.Actions)); return(code.ToString()); }
private static string FormatStreamName(MetaFormulaItem arg) { return(SourceFormatter.FormatSource(arg, "close")); }