Code cleanup.

This commit is contained in:
2025-02-20 10:34:04 -05:00
parent cc353a4563
commit aebd58be25
2 changed files with 4 additions and 7 deletions

View File

@@ -1,16 +1,12 @@
using MarketData.Cache; using MarketData.Cache;
using MarketData.DataAccess; using MarketData.DataAccess;
using MarketData.Generator.Indicators;
using MarketData.Generator.MovingAverage; using MarketData.Generator.MovingAverage;
using MarketData.Helper;
using MarketData.MarketDataModel; using MarketData.MarketDataModel;
using MarketData.Numerical; using MarketData.Numerical;
using MarketData.Utils; using MarketData.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MarketData.Generator.CMTrend namespace MarketData.Generator.CMTrend
{ {
@@ -206,7 +202,8 @@ namespace MarketData.Generator.CMTrend
} }
// Trend #8 check. Evaluate the RSI // Trend #8 check. Evaluate the RSI
RSICollection rsiCollection=RSIGenerator.GenerateRSI(symbol,currentPrice.Date,30); // generate a 14 day standard RSI with 30 days of pricing data // generate a 14 day standard RSI with 30 days of pricing data
RSICollection rsiCollection=RSIGenerator.GenerateRSI(symbol,currentPrice.Date,30);
if(null==rsiCollection||0==rsiCollection.Count||rsiCollection[rsiCollection.Count-1].RSI<cmtParams.MinRSI) if(null==rsiCollection||0==rsiCollection.Count||rsiCollection[rsiCollection.Count-1].RSI<cmtParams.MinRSI)
{ {
cmtCandidate.Violation=true; cmtCandidate.Violation=true;

View File

@@ -71,8 +71,8 @@ namespace MarketData.Generator.CMTrend
MaxBeta=10.00; // Candidates with Beta that exceed this are rejected. MaxBeta=10.00; // Candidates with Beta that exceed this are rejected.
UseMaxBeta=false; // Utilize the MaxBeta filter UseMaxBeta=false; // Utilize the MaxBeta filter
UseProfitMaximization=true; // Maximize profits when setting stop limits. What this does is to instead of using 3*ATR(20) it will use UseProfitMaximizationATRMultiplier*ATR(20) to set the stop limit for R's greater than or equal to UseProfitMaximizationRs UseProfitMaximization=true; // Maximize profits when setting stop limits. What this does is to instead of using 3*ATR(20) it will use UseProfitMaximizationATRMultiplier*ATR(20) to set the stop limit for R's greater than or equal to UseProfitMaximizationRs
UseProfitMaximizationExpression="R_THRESSHOLD=4;MAX_ATR=3;MULTIPLIER=MAX_ATR;IF(RMultiple>=R_THRESSHOLD){MULTIPLIER=1.2;}"; UseProfitMaximizationExpression="R_THRESSHOLD=4;MAX_ATR=3;MULTIPLIER=MAX_ATR;IF(RMultiple>=R_THRESSHOLD){MULTIPLIER=1.2;}"; // The default ATR multiplier is 3 which will maintain a wider gap. 1.2 will follow more closely
UseTradeOnlySectors=false; // If set to true then only consider companies in specified sector UseTradeOnlySectors=false; // If set to true then only consider companies in specified sectors
UseTradeOnlySectorsSectors="Healthcare,Technology,Basic Materials,Consumer Defensive,Industrials"; UseTradeOnlySectorsSectors="Healthcare,Technology,Basic Materials,Consumer Defensive,Industrials";
} }
public bool SuspendTrading{get;set;} public bool SuspendTrading{get;set;}