This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//+------------------------------------------------------------------+ | |
//| My Money Management.mq4 | | |
//| Ryan Sheehy, CurrencySecrets.com | | |
//| http://www.currencysecrets.com | | |
//+------------------------------------------------------------------+ | |
#property copyright "Ryan Sheehy, CurrencySecrets.com" | |
#property link "http://www.currencysecrets.com" | |
//--- input parameters | |
extern double xRiskPerTrade=1; // $ amount of risked per trade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//+------------------------------------------------------------------+ | |
//| My Automated Trading EA.mq4 | |
//| Copyright 2013, Ryan Sheehy | |
//| http://www.currencysecrets.com | |
//+------------------------------------------------------------------+ | |
#property copyright "Copyright 2013, Ryan Sheehy" | |
#property link "http://www.currencysecrets.com" | |
//--- input parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string VERSION = "TL BO 1.0"; | |
// external global variables | |
extern int EXT_SWINGS = 2; // swing level, 0 is lowest, 2 is most common | |
extern int EXT_NO_SWING_LMT = 12; // don't consider the latest X bars as swing points to draw trend lines | |
extern int EXT_ATR = 300; // ATR(x) | |
extern double EXT_ATR_MAX_SLOPE = 0.05; // multiple of ATR that would be considered maximum slope | |
extern double EXT_ATR_BUFFER = 0.05; // multiple of ATR to add to low/high for it to be considered a "touch" | |
extern int EXT_NULL_CLOSES = 0; // number of closes beyond trend line to nullify it as a valid trend line | |
extern int EXT_NUM_TOUCHES = 3; // (inclusive) number of touches needed to be considered a valid trend line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//+------------------------------------------------------------------+ | |
//| Automated Trend Lines.mq4 | | |
//| Ryan Sheehy, CurrencySecrets.com | | |
//| http://www.currencysecrets.com | | |
//+------------------------------------------------------------------+ | |
#property copyright "Ryan Sheehy, CurrencySecrets.com" | |
#property link "http://www.currencysecrets.com" | |
/* | |
* This script automates the generation and plotting of sloping trend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Name: Automatic Trend Lines | |
* This Amibroker script is designed to automate the process of drawing: | |
* 1. Trend lines (sloping) | |
* 2. Support & resistance lines (horizontal) | |
* 3. Channel lines (parallel lines to trend lines & horizontal lines) | |
* This script is not a recommendation to buy or sell anything. It's to be | |
* used as is without any guarantees or warranties on its reliability. | |
* Author: Ryan Sheehy | |
* Version: v2.0.2 (20160816) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//+------------------------------------------------------------------+ | |
//| Copyright © 2009 MTIntelligence.com | | |
//| http://www.mtintelligence.com | | |
//+------------------------------------------------------------------+ | |
#property copyright "Copyright © 2009 MTIntelligence.com" | |
#property link "http://www.mtintelligence.com" | |
// ************************************************************************************* | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//+------------------------------------------------------------------+ | |
//| calculate-atr-trailing-stop.mq4 | |
//| Copyright 2013, Currency Secrets | |
//| http://www.currencysecrets.com | |
//+------------------------------------------------------------------+ | |
#property copyright "Copyright 2013, Currency Secrets" | |
#property link "http://www.currencysecrets.com" | |
//--- input parameters | |
extern int extLookBack = 50; // bars to look back for the ATR indicator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This method calculates the profit or loss of a position in the home currency of the account | |
* @param string sym | |
* @param int type 0 = buy, 1 = sell | |
* @param double entry | |
* @param double exit | |
* @param double lots | |
* @result double profit/loss in home currency | |
*/ | |
double calcPL(string sym, int type, double entry, double exit, double lots) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void flushArray( int& arr[] ) { | |
ArrayInitialize( arr, 0 ); | |
ArrayResize( arr, 0 ); | |
} | |
// append new element to end of int array | |
void intArrayPush( int& arr[], int elem ) { | |
int size = ArraySize( arr ); | |
ArrayResize( arr, size + 1 ); | |
arr[ size ] = elem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* clearIntArray | |
* This function deletes all items in array (sets it to 0) and resizes array according to size (default = 1). | |
* @param int& theArray - passing the array by reference | |
* @param int size - size of the array (default = 1) | |
* @return int blank array of size | |
*/ | |
int clearIntArray( int& theArray[], int size = 0 ) { | |
ArrayResize( theArray, size ); | |
if ( size > 0 ) { ArrayInitialize( theArray, 0 ); } |
NewerOlder