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
//+------------------------------------------------------------------+ | |
//| EoFY.mq4 | | |
//| Ryan Sheehy, RobotTradingForex.com | | |
//| https://robottradingforex.com | | |
/* | |
* DON'T FORGET TO SELECT "ALL HISTORY" FROM ACCOUNT HISTORY TAB!!! | |
* This script helps to calculate a summarised version of all trades | |
* done in a particular financial year. It converts all sales and | |
* purchase transactions into the base currency. | |
* 1. Loop through all HISTORICAL trades between a predetermined date |
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
//+------------------------------------------------------------------+ | |
//| 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
// this procedure checks all manually placed orders | |
void checkManualOrders() { | |
for ( int i = 0; i < OrdersTotal(); i++ ) { | |
if ( OrderSelect(i, SELECT_BY_POS, MODE_TRADES) ) { | |
// the assumption will be that new manually placed pending orders have a MagicNumber of 0 | |
// check with your MT4 broker that they allow MagicNumbers, some brokers do NOT! | |
// if your broker doesn't then you'll have to remove "OrderMagicNumer() == 0 &&" | |
if ( OrderMagicNumber() == 0 && OrderCloseTime() == 0 ) { | |
if ( OP_BUYLIMIT || OP_BUYSTOP || OP_SELLLIMIT || OP_SELLSTOP ) { | |
// okay you're now here on an active PENDING order, what do you want to do? |
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
/* | |
* Get the price of the Stop Loss according to last swing price. | |
* @param sym string Symbol of currency being analysed | |
* @param TF int TimeFrame of the currency being analysed | |
* @param ord int OrderType() = OP_BUYLIMIT, OP_BUYSTOP, OP_SELLLIMIT, OP_SELLSTOP | |
* @param entry double Entry price of the order | |
* @return double Last swing point | |
*/ | |
double getLastSwingPrice(string sym, int TF, int ord, double entry) { | |
int bars = iBars(sym,TF); |
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
/* | |
* Calculates the position size of the trade based upon entry price, stop loss & amount risked. | |
* @param entryPrice double Entry price of the order | |
* @param iniStop double Initial stop loss of the order | |
* @param riskAmt double Risk per trade (in dollars of account's currency) | |
* | |
* @return amount in mini-lots | |
*/ | |
double getLots( double entryPrice, double iniStop, double riskAmt ) { | |
string sym = Symbol(); |
NewerOlder