public AlgoMetaDataBuilder WithFunction(FunctionParamsDTO functionParams, FunctionType functionType) { if (functionParams != null) { AlgoMetaDataFunction functionMetaData = new AlgoMetaDataFunction(functionType) { Id = functionParams.FunctionInstanceIdentifier, Parameters = GetParamBuilder().CreateParameters() //.WithParameterFunctionInstanceIdentifier(functionParams.FunctionInstanceIdentifier) .WithParameterStartingDate(functionParams.StartingDate.ToString(GlobalConstants.ISO_8601_DATE_FORMAT)) .WithParameterEndingDate(functionParams.EndingDate.ToString(GlobalConstants.ISO_8601_DATE_FORMAT)) .WithParameterAssetPair(functionParams.AssetPair) .WithParameterPeriod(functionParams.Period) .WithParameterCandleOperationMode(functionParams.CandleOperationMode) .WithParameterCandleTimeInterval(functionParams.CandleTimeInterval) .Build() }; // Make keys for functions parametes camelCase ChangeKeyToCamelCase(functionMetaData); algoMetaDataInformation.Functions.Add(functionMetaData); } return(this); }
private void ChangeKeyToCamelCase(AlgoMetaDataFunction functionMetaData) { foreach (var item in functionMetaData.Parameters) { item.Key = FirstCharToLowerCase(item.Key); } }
public AlgoMetaDataBuilder WithFunction(FunctionParamsDTO functionParams, FunctionType functionType) { if (functionParams != null) { AlgoMetaDataFunction functionMetaData = new AlgoMetaDataFunction(functionType) { Id = functionParams.FunctionInstanceIdentifier, Parameters = GetParamBuilder().CreateParameters() .WithParameterFunctionInstanceIdentifier(functionParams.FunctionInstanceIdentifier) .WithParameterStartingDate(functionParams.StartingDate.ToString(Constants.ISO_8601_DATE_FORMAT)) .WithParameterEndingDate(functionParams.EndingDate.ToString(Constants.ISO_8601_DATE_FORMAT)) .WithParameterAssetPair(functionParams.AssetPair) .WithParameterCapacity(functionParams.Capacity) .WithParameterCandleOperationMode(functionParams.CandleOperationMode) .WithParameterCandleTimeInterval(functionParams.CandleTimeInterval) .Build() }; algoMetaDataInformation.Functions.Add(functionMetaData); } return(this); }