Hey all, I am a little (actually a lot) embarrassed to ask this about this EA but here goes. I found the thread on another forex factory section and I copied and pasted the first portion of the EA below. My broker is FXDD. Where exactly does the code begin in the EA below? It looks like the beginning of the code is general information and that possible the EA begins where it says:
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
...however I may be way off! Obviously I have never used an EA before and hopefully I can use it in Demo mode for awhile. Thanks for any help I can get!
Brett
//+-----------------------------------------------------------------------------+
//| Daily Scalping v1.0h.mq4 |
//| Skyline 2007 |
//| |
//+-----------------------------------------------------------------------------+
#property copyright "Skyline 2007"
#property link ""
#include <stdlib.mqh>
// v1.0 (07 Feb 2007) : Start Project
// v1.0a (07 Feb 2007) : Add GMT_Shift variable
// v1.0b (16 Feb 2007) : Added MagicNumber routine based on pair and timeframe
// v1.0c (17 Feb 2007) : Added routine TotalOrders to count only active order related to current EA (Thanks to Vitalykk)
// Added routine OrdersLossInDay to control losses in the same day. Users have the option to change how much loss trade they want setting external variable MaxLossesTradesPerDay.
// v1.0d (19 Feb 2007) : Fixed bug that prevent , when an order was not dispatched, to open reverse trade correctly.
// Handled the case of doji candle that EA now will ignore to determine the trend situation from last 3 candles.
// v1.0e (19 Feb 2007) : Fixed bug on CheckTrend for doji candle routine (Thanks to Vitalykk)
// Added function OrdersTakeProfit to avoid EA enter again the market until next day.
// v1.0f (07 Mar 2007) : Midnight order will be opened until 00:01
// v1.0g (09 Mar 2007) : Removed v1.0f limit about order opening.Introducing FirstOrderDone to handle the first order.
// v1.0h (20 Mar 2007) : Fixed error on SL and added comment in case of error opening order to better debug EA.
// Add global variables MidnightOrderOpened, TradeStatus to avoid losing variable values if recompile after EA is on chart.
// Add TrailingStop routine, if =0 Trailing is disable otherwise it will trail using TrailingStop pips.
//---- Definizione parametri esterni
extern double GMT_Shift = 1;
extern int TakeProfit = 200;
extern int StopLoss = 40;
extern int HourToCloseOrders = 17;
extern bool SundayCandleExists = true;
extern double Lots = 0.1;
extern bool UseMoneyManagement = true;
extern int Risk = 10;
extern int Slippage = 3;
extern int MaxLossesTradesPerDay = 2;
extern int TrailingStop = 0;
//extern bool UseATR_for_TP = false;
//extern bool UseATR_for_SL = false;
//extern double PercentageATR_for_TP = 10;
//extern double PercentageATR_for_SL = 10;
//----- Definizione parametri interni
// Definition Global Variable
// MidnightOrderOpened = 0 not assigned (first EA run), =1 order still to be opened, =2 order already opened
// TradeStatus = 0 Trades disabled , = 1 Open only Buy orders , = 2 Open only Sell orders
int MagicNumber;
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
string TradeMode,Temp;
// Calcola dimensione Lot in base all'Equity
if (UseMoneyManagement==true) Lots = CalcolaLot(Risk);
// Calcola MagicNumber a seconda della coppia e timeframe
MagicNumber = MagicFromSymbol();
// Gestione variabile globale
GlobalVariable();
// Attiva ordine alle 00:00 GMT
OpenOrderMidnight(Lots);
// Controlla ordini chiusi in perdita
OrdersLossInDay();
// Controlla se TP è stato raggiunto
OrdersTakeProfit();
// Attiva ordini successivi
OpenNextOrders(Lots);
// Chiude ordini allo scadere di HourToCloseOrders
CloseAllOrders(HourToCloseOrders);
// Effettua il TrailingStop
TrailingStop();
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
...however I may be way off! Obviously I have never used an EA before and hopefully I can use it in Demo mode for awhile. Thanks for any help I can get!
Brett
//+-----------------------------------------------------------------------------+
//| Daily Scalping v1.0h.mq4 |
//| Skyline 2007 |
//| |
//+-----------------------------------------------------------------------------+
#property copyright "Skyline 2007"
#property link ""
#include <stdlib.mqh>
// v1.0 (07 Feb 2007) : Start Project
// v1.0a (07 Feb 2007) : Add GMT_Shift variable
// v1.0b (16 Feb 2007) : Added MagicNumber routine based on pair and timeframe
// v1.0c (17 Feb 2007) : Added routine TotalOrders to count only active order related to current EA (Thanks to Vitalykk)
// Added routine OrdersLossInDay to control losses in the same day. Users have the option to change how much loss trade they want setting external variable MaxLossesTradesPerDay.
// v1.0d (19 Feb 2007) : Fixed bug that prevent , when an order was not dispatched, to open reverse trade correctly.
// Handled the case of doji candle that EA now will ignore to determine the trend situation from last 3 candles.
// v1.0e (19 Feb 2007) : Fixed bug on CheckTrend for doji candle routine (Thanks to Vitalykk)
// Added function OrdersTakeProfit to avoid EA enter again the market until next day.
// v1.0f (07 Mar 2007) : Midnight order will be opened until 00:01
// v1.0g (09 Mar 2007) : Removed v1.0f limit about order opening.Introducing FirstOrderDone to handle the first order.
// v1.0h (20 Mar 2007) : Fixed error on SL and added comment in case of error opening order to better debug EA.
// Add global variables MidnightOrderOpened, TradeStatus to avoid losing variable values if recompile after EA is on chart.
// Add TrailingStop routine, if =0 Trailing is disable otherwise it will trail using TrailingStop pips.
//---- Definizione parametri esterni
extern double GMT_Shift = 1;
extern int TakeProfit = 200;
extern int StopLoss = 40;
extern int HourToCloseOrders = 17;
extern bool SundayCandleExists = true;
extern double Lots = 0.1;
extern bool UseMoneyManagement = true;
extern int Risk = 10;
extern int Slippage = 3;
extern int MaxLossesTradesPerDay = 2;
extern int TrailingStop = 0;
//extern bool UseATR_for_TP = false;
//extern bool UseATR_for_SL = false;
//extern double PercentageATR_for_TP = 10;
//extern double PercentageATR_for_SL = 10;
//----- Definizione parametri interni
// Definition Global Variable
// MidnightOrderOpened = 0 not assigned (first EA run), =1 order still to be opened, =2 order already opened
// TradeStatus = 0 Trades disabled , = 1 Open only Buy orders , = 2 Open only Sell orders
int MagicNumber;
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
string TradeMode,Temp;
// Calcola dimensione Lot in base all'Equity
if (UseMoneyManagement==true) Lots = CalcolaLot(Risk);
// Calcola MagicNumber a seconda della coppia e timeframe
MagicNumber = MagicFromSymbol();
// Gestione variabile globale
GlobalVariable();
// Attiva ordine alle 00:00 GMT
OpenOrderMidnight(Lots);
// Controlla ordini chiusi in perdita
OrdersLossInDay();
// Controlla se TP è stato raggiunto
OrdersTakeProfit();
// Attiva ordini successivi
OpenNextOrders(Lots);
// Chiude ordini allo scadere di HourToCloseOrders
CloseAllOrders(HourToCloseOrders);
// Effettua il TrailingStop
TrailingStop();