Skip to content

Logic to determine if the current price is cheap or expensive in candlestick.

Notifications You must be signed in to change notification settings

KeisukeIwabuchi/CandleTrailing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

CandleTrailing

Logic to determine if the current price is cheap or expensive in candlestick.

Description

First of all, this logic waits X% for candlestick formation. For example, if it is set to wait 50% on the daily chart, you will have to wait for half a day.
It is 30 minutes if it is 50% on 1 hour foot.

When the wait time is over, we record high and low candlesticks at that point.
It is a logic aimed at generating a buying signal at a price higher than the high price at this time and a selling signal at a price cheaper than the low price.

However, there is a possibility that this high / low will still be renewed, so if you generate a signal just by exceeding high price and low price, you will miss entries with better price.
Therefore, using the trailing stop method, we will update the price of signal generation every time we update highs and lows. From updating of high and low prices, if only Ypips goes backwards, it generates a signal.
(Conditions for backlighting are conditions that are more favorable than highs and lows at the end of waiting time)

Requirement

Install

  • Download CandleTrailing.mqh
  • Save the file to /MQL4/Includes

Usage

Includes header file.
#include <CandleTrailing.mqh>

Create an instance.
The first argument of the constructor is the trailing width (pips), and the second argument is the percentage of waiting time (%).

CandleTrailing *CT;

int OnInit()
{
   CT = new CandleTrailing(1, 50);
   return(INIT_SUCCEEDED);
}

It receives the judgment and executes processing according to the result.
0: No signal, 1: buy signal, -1: sell signal
int signal = CT.Signal();

About

Logic to determine if the current price is cheap or expensive in candlestick.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages