BlogWeb
-
8 min readArrays in MATLAB are fundamental data structures that allow the storage and manipulation of collections of values. An array is defined as a variable that can hold multiple elements of the same data type. In MATLAB, arrays can be created and manipulated using various methods.Creating arrays:One way to create an array is by manually entering the elements enclosed in square brackets ([]). For example, to create a 1-dimensional array, you can use the syntax: array = [1, 2, 3, 4, 5].
-
7 min readTo test a private function in Kotlin, you can follow these steps:Import the necessary testing dependencies: Depending on your build tool, you need to add the appropriate testing framework in your project, such as JUnit or KotlinTest. Create a new test class: Create a separate test class file that corresponds to the file containing the private function you want to test. Use reflection: Kotlin does not provide direct access to private functions.
-
8 min readThe Chande Momentum Oscillator (CMO) is a technical analysis tool that measures the momentum of a security's price movement. It was developed by Tushar Chande, a renowned technical analyst, to provide a more accurate reflection of market conditions by filtering out market noise.The CMO is a bounded oscillator that oscillates between -100 and +100. The indicator calculates the difference between the sum of gains and the sum of losses over a specified period.
-
4 min readTo switch between multiple versions of Kotlin, you can follow these steps:Open your Kotlin project in your desired integrated development environment (IDE). Locate the build.gradle file in your project's root directory. Inside the build.gradle file, find the kotlin-gradle-plugin dependency declaration. It will look something like this: dependencies { implementation "org.jetbrains.
-
10 min readIn MATLAB, errors and exceptions are situations that occur during the execution of a program that can disrupt its normal flow. MATLAB provides various mechanisms to handle these errors and exceptions effectively. Here are some techniques commonly used to handle errors and exceptions in MATLAB:Try-Catch Statements: A try-catch statement allows you to execute a block of code and catch any errors or exceptions that occur during its execution.
-
5 min readTo check if a server is reachable using Retrofit in Kotlin, you can follow the steps below:Import the necessary dependencies in your Kotlin project. This includes the Retrofit library and the required network permission in your AndroidManifest.xml file: implementation 'com.squareup.retrofit2:retrofit:2.x.x' implementation 'com.squareup.retrofit2:converter-gson:2.x.x' Create an interface for your API using Retrofit annotations.
-
7 min readTo write data to a file in MATLAB, you can follow these steps:Open the file for writing using the fopen function. Specify the file name, mode (e.g., 'w' for writing), and encoding if required. For example: fileID = fopen('filename.txt', 'w'); Use the fprintf function to write data to the file. This function allows you to write formatted data. Provide the file identifier obtained from fopen as the first input argument, followed by the data you want to write.
-
9 min readOn-Balance Volume (OBV) is a technical analysis indicator used to measure the positive and negative volume flow in a security or market. It provides insights into the buying and selling pressure behind a security's price movement. Interpreting OBV involves analyzing the patterns and trends formed by the indicator.OBV is based on the principle that volume precedes price movement. When OBV is rising, it suggests that buying volume is increasing, indicating bullish sentiment.
-
5 min readIn Kotlin, you can create a list of objects using various methods. Here are a few ways to achieve this:Using the listOf() function: You can create a read-only list using the listOf() function. It takes any number of arguments and returns an immutable list containing those elements.
-
6 min readTo read data from a file in MATLAB, you can use the built-in functions fopen, fscanf, and fclose. Here are the steps:Open the file using fopen: Use the fopen function to open the file and obtain a file identifier. Syntax: fid = fopen(filename), where filename is a string specifying the file path and fid is the file identifier. Read data from the file using fscanf: With the file identifier obtained from step 1, you can use the fscanf function to read formatted data from the file.
-
8 min readThe Triangular Moving Average (TMA) is a technical analysis indicator used to smooth out price fluctuations and identify trends in a financial asset's price over a specific period. It is called a "triangular" moving average because the averaging formula assigns higher weights to the prices in the middle of the time period and lower weights to the prices at the beginning and end.The TMA is calculated by taking the average of prices over a chosen period, creating a single value.