Posts - Page 48 (page 48)
-
7 min readCandlestick patterns are a popular tool in technical analysis used by traders to predict future price movements in the financial markets. These patterns derive their name from the shape of the candle they form on price charts.Candlestick patterns consist of two main components: the body and the wick or shadow. The body represents the range between the opening and closing prices, while the wick indicates the high and low prices reached during the given time period.
-
7 min readTo drag an SVG rectangle in d3.js, you need to implement the drag behavior using the d3.drag() function. Here is how you can do it:First, select the rectangle element that you want to make draggable using the d3.select() function and store it in a variable. var rect = d3.select("rect"); Next, define the drag behavior function that will be triggered when you start dragging the rectangle. Within this function, you can update the coordinates of the rectangle based on the drag event.
-
6 min readCommodity Channel Index (CCI) is a technical analysis tool that is commonly used by traders and investors to identify overbought and oversold market conditions, as well as potential trend reversals. It was developed by Donald Lambert in 1980.The CCI is a momentum-based oscillator that measures the current price level relative to an average price level over a specific period of time, typically 20 periods.
-
5 min readIn D3, you can conditionally remove elements by using the filter method along with a callback function that determines whether to keep or remove each element.Here is an example of how you can conditionally remove elements based on a specific condition: // Select the elements you want to filter/remove (e.g., circles with class "data-point") const circles = d3.selectAll("circle.data-point"); // Apply the filtering circles.
-
10 min readTo create a bar chart using d3.js, you can follow these steps:Start by including the d3.js library in your HTML document. You can download it from the d3.js website or include it using a CDN (Content Delivery Network). Create an SVG (Scalable Vector Graphics) element in your HTML document where the bar chart will be rendered. You can do this by adding an SVG element to your HTML, specifying the width and height. In your JavaScript code, select the SVG element using d3.
-
7 min readWilliams %R, also known as Williams Percent Range, is a popular technical analysis indicator used in trading to identify overbought and oversold conditions in the market. Developed by renowned trader and author Larry Williams, it is primarily used to determine potential reversal points in price movements.Williams %R is a momentum oscillator that oscillates between 0 and -100. It measures the level of the latest closing price relative to the high-low range of a specified period.
-
10 min readTo load SVG files with D3, you can follow these steps:First, include the D3 library in your project by adding the following script tag to your HTML or by downloading and including the library file in your project directory. Next, create an SVG container using D3. Select an HTML element where you want to append the SVG and create a container with a specific width and height. For example: const svg = d3.select("body") .append("svg") .attr("width", 500) .
-
6 min readTrading with Average True Range (ATR) is a commonly used strategy in technical analysis to identify potential entry and exit points in the market. The ATR indicator measures the volatility of an asset by calculating the average range between high and low prices over a certain period of time.To trade with ATR, you follow these steps:Determine the ATR period: Decide on the number of periods you want to use in your calculation.
-
10 min readIn d3.js, you can display an array of objects using various methods and techniques. One common approach is to use the data() method in conjunction with enter() and append() functions to dynamically create HTML elements based on the array elements.Here's an example of how you can display an array of objects in d3.js:First, select the parent DOM element where you want to display the array.Use the data() method to bind the array to a selection of DOM elements.
-
6 min readTo set margin or padding in a canvas object using d3.js, you can follow these steps:First, select the canvas element using D3's select() method. For example: var canvas = d3.select("canvas"); Next, define the width and height of the canvas element using the attr() method to set the "width" and "height" attributes. This will determine the size of the canvas where the visual elements will be drawn: canvas.attr("width", width); canvas.
-
9 min readThe Ichimoku Cloud is a technical analysis indicator that was developed by a Japanese journalist named Goichi Hosoda in the late 1930s. It is a comprehensive trading system that provides various levels of support and resistance, as well as signals for potential trend reversals and trend strength.The Ichimoku Cloud consists of five components, namely:Tenkan-sen (Conversion Line): This line is calculated by taking the average high and low prices over a specified period, usually 9 periods.
-
7 min readUnit testing in Kotlin is a crucial part of software development as it allows developers to verify the correctness of individual units of code, such as functions or classes, in isolation. Here are the steps to perform unit testing in Kotlin:Import the required testing framework: Kotlin supports multiple testing frameworks such as JUnit and Spek. You need to add the necessary dependencies in your build file, such as Gradle, to import the testing framework you prefer.