All Downloads are FREE. Search and download functionalities are using the official Maven repository.

in.kncsolutions.dhelm.candlepattern.oneline.BearishBeltHold Maven / Gradle / Ivy

Go to download

This library provides the necessary implementations to screen the following patterns: Bullish Belt Hold Bearish Belt Hold Hammer Hanging Man Southern Doji Northern Doji Gapping Up Doji Gapping Down Doji Takuri Line One Candle Shooting Star Bullish Strong Line Bearish Strong Line Bullish Harami Bearish Harami Bullish Engulfing Bearish Engulfing Bullish Kicking Bearish Kicking Matching Low Matching High Bullish Harami Cross Bearish Harami Cross Bullish Doji Star Bearish Doji Star Dark Cloud Cover Piercing Line Descending Hawk Homing Pigeon Bullish Abandoned Baby Bearish Abandoned Baby Three Inside Up Three Inside Down Three Outside Up Three Outside Down Three White Soldiers Three Black Crows Morning Doji Star Evening Doji Star Morning Star Evening Star Upside Tasuki Gap Downside Tasuki Gap Bullish Side by Side White Lines Bearish Side by Side White Lines Rising Three Method

There is a newer version: 1.0.4
Show newest version
/**
 *Copyright 2017 Pallav Nandi Chaudhuri@Knc Solutions Private Limited

  *Licensed under the Apache License, Version 2.0 (the "License");
  *you may not use this file except in compliance with the License.
  *You may obtain a copy of the License at

  * http://www.apache.org/licenses/LICENSE-2.0

  *Unless required by applicable law or agreed to in writing, software
  *distributed under the License is distributed on an "AS IS" BASIS,
  *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  *See the License for the specific language governing permissions and
  *limitations under the License.
 */
 package in.kncsolutions.dhelm.candlepattern.oneline;
 import java.util.*; 
 import in.kncsolutions.dhelm.candlebasic.*;
 import in.kncsolutions.dhelm.exceptions.DataException;
 import in.kncsolutions.dhelm.mathcal.Mathfns;
 /**
 *According to literature the Bearish belthold pattern is a single line pattern composed of
 *a opening black marubozu basic candle. It has a long body. Here the lower shadow should be significantly smaller than
 *the body. Important parameter of this pattern is the fact that the lower shadow should be how much smaller
 *than the body.
 */
 
 public class BearishBeltHold{
   private List Open=new ArrayList();
   private List High=new ArrayList();
   private List Low=new ArrayList();
   private List Close=new ArrayList();
   private int RefLength;
   private int RefTrend;
   private double Percentage1;
   private double Percentage2;
   private double []trendPrior={0,0};
   private boolean isBearishBeltHold;
  /**
  *@param open : List of opening prices where first element is the latest data.
  *@param high : List of high prices where first element is the latest data.
  *@param low : List of low prices where first element is the latest data.
  *@param close : List of closing prices where first element is the latest data.
  *@param numLen :  Number of previous periods w.r.t which it is to be found that if the latest candle is long or short.
  *@param numTrend : Number of previous periods w.r.t which the previous trend have to be approximated.
  *@param p1 : The percentage by which if the latest candle is longer than the previous candles, it will be treated as a long candle, otherwise short.
  *@param p2 : The percentage by which the lower shadow should be smaller than the body in case the latest candle is a opening black marubozu candle.
  *@throws DataException if sufficient data not available.
  */
   public BearishBeltHold(List open,List high,List low,List close, int numLen,int numTrend, double p1,double p2)throws DataException{
    Open.addAll(open);
	 High.addAll(high);
	 Low.addAll(low);
	 Close.addAll(close);
	 RefLength=numLen;
	 RefTrend=numTrend;
	 Percentage1=p1;
	 Percentage2=p2;
	 isBearishBeltHold=false;
	 if(Open.size()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy