Formation Logo
Brijon Concept of Threes
MQ4 API
 
Functions | Variables

Indicator Support

Functions
Collaboration diagram for Indicator Support:

Functions

void UpdateBuffer (double &buffer[], double &new_current_value, int buffer_timeframe, datetime &last_buffer_update)
 UpdateBuffer():
void GetVolume ()
 This breathtaking code comes courtesy of squalou.
double CalculateVolatility (int period, int LookBack)
 Calculates the volatility of a pair based on an average of their movement over LookBack periods.
void ReadIndicatorValues ()
 This function calls GetTradeDirectionFromTrend.
void DrawLine (string name, datetime time1, double val1, datetime time2, double val2, color col, int width, int style, int ray)
 Plots a trendline with the given parameters.
void CalculateThreesLines ()
 Draws the hi-lo of the previous candle, plus the open of current candle at an appropriate colour.
void CalculateReEntryLinePips ()
 Calculate the reEntry line pips.
void ReplaceReEntryLine ()
 Replace the reEntry line.
void CalculateBosunLines ()
 The calculations code for this comes from Bosun_Kines.mq4, coded by IgorAD and modified by Kris.
void GetBosunPosition ()
 Get next Bosun next resistance and support.
void GetSquare ()
 The square is a yellow box that defines the highest and lowest of the previous 3 candles, with a user choice of time frame.
void SquareTouchTest ()
 Sends alert at a touch of the square.
double iLsma (int LSMA_Period, int shift)
 Code to calculate LSMA value.
void AddReEntryLine (double price)
 Draws a line for reentry at a price.

Variables

double UpTicksM1Buffer [TICKS_BUFFER_MAX_BARS]
 M1 "buffers" of UpTicks and DownTicks.
datetime UpTicksM1Buffer_lastupdate = 0
 M1 "buffers" UpTicksM1Buffer_lastupdate Time.

Function Documentation

void AddReEntryLine ( double  price)

Draws a line for reentry at a price.

 if (OrderType() == OP_BUY) 
   AddReEntryLine(NormalizeDouble(OrderOpenPrice() - (ReEntryLinePips * Point), Digits) ); 

Definition at line 2209 of file Brijon_Concept_of_Threes_auto_trading_robot_by_Steve_Hopwood.mq4.

void CalculateBosunLines ( )

The calculations code for this comes from Bosun_Kines.mq4, coded by IgorAD and modified by Kris.

My thanks to both of these individuals.

Definition at line 1905 of file Brijon_Concept_of_Threes_auto_trading_robot_by_Steve_Hopwood.mq4.

void GetVolume ( )

This breathtaking code comes courtesy of squalou.

Breathtaking. Cheers sq; you are a star.

Definition at line 1513 of file Brijon_Concept_of_Threes_auto_trading_robot_by_Steve_Hopwood.mq4.

double iLsma ( int  LSMA_Period,
int  shift 
)

Code to calculate LSMA value.

Copied from MrPip's work. Many thanks, MrPip

 //Fast lsma
   LsmaFastVal = iLsma(LSMA_Period_Fast, shift);
   PrevLsmaFastVal = iLsma(LSMA_Period_Fast, shift + 1);

Definition at line 2163 of file Brijon_Concept_of_Threes_auto_trading_robot_by_Steve_Hopwood.mq4.

void UpdateBuffer ( double &  buffer[],
double &  new_current_value,
int  buffer_timeframe,
datetime &  last_buffer_update 
)

UpdateBuffer():

  • update a "buffer" array with a new value;
  • shift the buffer one position at every new "bar" opening;
  • buffer[] therefore works like Indicators "Buffers" (or "Series"):
  • buffer[0] gives the buffer value for the CURRENT "bar";
  • buffer[3] gives the buffer value from 3 "bars" ago;
     UpdateBuffer(UpTicksM1Buffer,   upValue,   PERIOD_M1, UpTicksM1Buffer_lastupdate); 
    

Definition at line 1477 of file Brijon_Concept_of_Threes_auto_trading_robot_by_Steve_Hopwood.mq4.

Make Controller Kit
 
Brijon