Formation Logo
Brijon Concept of Threes
MQ4 API
 
Functions | Variables

Brijon_Concept_of_Threes_auto_trading_robot_by_Steve_Hopwood.mq4 File Reference

A Creation by Steve Hopwood using the comcept of threes by Brijon. More...

Include dependency graph for Brijon_Concept_of_Threes_auto_trading_robot_by_Steve_Hopwood.mq4:

Go to the source code of this file.

Functions

void DisplayUserFeedback ()
 This function is called to display feedback onto the screen in the Comment area.
int Get_X_Digit_Multiplier ()
 Creates a multiplier that adapts pips to the proper criminal Digits.
bool SendSingleTrade (int type, string comment, double lotsize, double price, double stop, double take)
 This function sends a single trade, checks for errors and verifies it has been opened.
bool DoesTradeExist ()
 Does this trade exist for this magicNumber and Symbol.
void LookForTradingOpportunities ()
 Trade entry logic, This is specific to this method.
bool CloseTrade (int ticket)
 Close a trade by using a specific ticket number.
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 LookForTradeClosure ()
 Close the trade if appropriate.
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 GetTradeDirection ()
 Get Trade direction.
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.
int GetMultiplier ()
 Returns a multiplying factor to turn the result of price calculations into full pips.
bool O_R_CheckForHistory (int ticket)
 This function is to work around a very annoying and dangerous bug in MT4: immediately after you send a trade, the trade may NOT show up in the order history, even though it exists according to ticket number.
void O_R_Sleep (double mean_time, double max_time)
 This sleeps a random amount of time defined by an exponential probability distribution.
double iLsma (int LSMA_Period, int shift)
 Code to calculate LSMA value.
string GetTradeDirectionFromTrend (int tf, int shift)
 Get the trade direction from the trend squalou coded this.
void AddReEntryLine (double price)
 Draws a line for reentry at a price.
bool CheckForHiddenStopLossHit (int type, int iPipsAboveVisual, double stop)
 Check for hidden stop loss hit,Reusable code that can be called by any of the stop loss manipulation routines except HiddenStopLoss().
void BreakEvenStopLoss ()
 Called from TradeManagementModule -Move stop loss to breakeven.
void JumpingStopLoss ()
 Called from TradeManagementModule - Jump sl by pips and at intervals chosen by user .
void HiddenStopLoss ()
 Called from TradeManagementModule if HideStopLossEnabled = true.
void HiddenTakeProfit ()
 Called from TradeManagementModule if HideStopLossEnabled = true.
void TrailingStopLoss ()
 Manages a trailing stop loss if enabled (TrailingStop = true)
void TradeManagementModule ()
 Managment function that handles a trade once it has been initiated.

Variables

double Lot = 1
 Lot size.
int MagicNumber = 0
 Magic Number.
string TradeComment = ""
 Optional Trade Comment.
bool CriminalIsECN = false
 Are you using a Criminal ECN.
bool SendAlertNotTrade = true
 Don't trade, send and alert instead.
bool TradeLong = true
 Trading direction choices.
bool TradeShort = true
 Trading direction choices.
int ClosureTargetPips = 3
 Trade closure.
bool UseCandleLength = false
 Take profit.
int TakeProfit = 0
 Take profit.
bool UseSquareForTakeProfit = false
 Take profit.
bool UseStopLoss = false
 Stop loss.
int StopLoss = 0
 Leave at 0 to use candle length.
bool UseSquareForStopLoss = false
 Use Square for Stop Loss.
string tdm = "----Automatic Trade direction----"
 CHOOSE ONE and ONLY ONE.
bool UseD1Close = false
 Use D1 Close for trade direction.
bool UseW1Close = false
 Use W1 Close for trade direction.
bool UseSquareFilter = true
 Use Square filter to determine direction.
bool UseVolume = true
 Use Volume upticks and downtick to determine direction.
int VolumeTickCountPeriod = 60
 Look peroid for voume count.
int MinTicksDifference = 20
 Ticks change used to determine direction if UseVolume == true.
int TicksCountBeforeTrading = 200
 How many ticks to requre before trading can begin.
bool UseLSMA = false
 Use LSMA for trade direction.
int LSMA_Period_Fast = 21
 LSMA_Period_Fast.
int LSMA_Period_Slow = 336
 LSMA_Period_Slow.
double UpTicksM1Buffer [TICKS_BUFFER_MAX_BARS]
 M1 "buffers" of UpTicks and DownTicks.
datetime UpTicksM1Buffer_lastupdate = 0
 M1 "buffers" UpTicksM1Buffer_lastupdate Time.

Detailed Description

A Creation by Steve Hopwood using the comcept of threes by Brijon.

Author:
Steve Hopwood
Version:
33
Date:
March 8 2011

Definition in file Brijon_Concept_of_Threes_auto_trading_robot_by_Steve_Hopwood.mq4.

Make Controller Kit
 
Brijon