init
This commit is contained in:
26
MarketDataLib/Generator/Indicators/VolumeTrendIndicator.cs
Normal file
26
MarketDataLib/Generator/Indicators/VolumeTrendIndicator.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using MarketData.MarketDataModel;
|
||||
using MarketData.Numerical;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MarketData.Generator.Indicators
|
||||
{
|
||||
public class VolumeTrendIndicator
|
||||
{
|
||||
private VolumeTrendIndicator()
|
||||
{
|
||||
}
|
||||
public static bool IsUptrend(Prices prices,int dayCount)
|
||||
{
|
||||
if(null==prices||prices.Count<dayCount) return false;
|
||||
float[] volume=prices.GetVolume();
|
||||
volume=volume.Take(dayCount).ToArray();
|
||||
volume=Numerics.Reverse(ref volume);
|
||||
double volumeSlope=Numerics.Slope(volume);
|
||||
return volumeSlope>0.00?true:false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user