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 function will return the quantity of orders (both open and pending) | |
// on the selected currency for the order type requested. | |
int getQtyOrders( int type, string sym ) { | |
int result = 0; | |
int tot = OrdersTotal(); | |
for ( int i = 0; i < tot; i++ ) { | |
if ( OrderSelect( i, SELECT_BY_POS, MODE_TRADES ) ) { | |
if ( OrderSymbol() == sym ) { | |
if ( OrderType() == type ) { | |
result += 1; |
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
//+------------------------------------------------------------------+ | |
//| Simple Channel Breakout System.mq4 | |
//| Copyright 2013, Ryan Sheehy | |
//| http://www.currencysecrets.com | |
//| v1.1 - errors fixed (getLots & multipleOrders) | |
//+------------------------------------------------------------------+ | |
#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
/* | |
* checkOpenTrades | |
* This function checks open trades and compares them to risk levels. | |
* @param sym | |
* @return int -1 = error | |
*/ | |
int checkOpenTrades( string sym ) { | |
int type, revType, tradeReady, tkt, dir; | |
double p, revP, profit, trailingStop; | |
for ( int i = 0; i < OrdersTotal(); i++ ) { |
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
//+------------------------------------------------------------------+ | |
//| CS Auto Trend Lines (Offline).mq4 | | |
//| Ryan Sheehy | | |
//| http://www.currencysecrets.com | | |
//| Version: 1.0 | | |
//| Released: 12 Jan 13 | | |
//+------------------------------------------------------------------+ | |
#property copyright "Ryan Sheehy" | |
#property link "http://www.currencysecrets.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
//+------------------------------------------------------------------+ | |
//| Period_Converter.mq4 | | |
//| Copyright © 2005-2007, MetaQuotes Software Corp. | | |
//| http://www.metaquotes.net | | |
//+------------------------------------------------------------------+ | |
#property copyright "Copyright © 2007, MetaQuotes Software Corp." | |
#property link "http://www.metaquotes.net" | |
#property show_inputs | |
#include <WinUser32.mqh> |
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
//+------------------------------------------------------------------+ | |
//| CS Trend Line Breakout.mq4 | | |
//| Ryan Sheehy | | |
//| http://www.currencysecrets.com | | |
//| Version: 3.0 | | |
//| Released: 7 Jan 13 | | |
//+------------------------------------------------------------------+ | |
#property copyright "Ryan Sheehy" | |
#property link "http://www.currencysecrets.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
/* | |
* 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 ); } |
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
//+------------------------------------------------------------------+ | |
//| Breakout Strategy Tester.mq4 | | |
//| Copyright 2012, MetaQuotes Software Corp. | | |
//| http://www.metaquotes.net | | |
//+------------------------------------------------------------------+ | |
// | |
// With this script we will be doing the following: | |
// 1. Get all the trades (be wary of reversal trades!) | |
// 2. | |
#property copyright "Copyright 2012, MetaQuotes Software Corp." |
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
//+------------------------------------------------------------------+ | |
//| Trades Analysis.mq4 | | |
//| Ryan Sheehy, CurrencySecrets.com | | |
//| http://www.currencysecrets.com | | |
//+------------------------------------------------------------------+ | |
#property copyright "Ryan Sheehy, CurrencySecrets.com" | |
#property link "http://www.currencysecrets.com" | |
/* | |
* With this script we will be running through all trades that have |