Jump to content

Functions in a professionally coded EA/trading robot

Guest EA-trader

Recommended Posts

Guest EA-trader

The following functions are useful in an EA, have them coded.Do you know of any other functions?


//--- Standard parameters
extern double Lots = 2.0;//£2 PER POINT
extern double TradeMaxRisk = 2; // TradeMaxRisk > 0 so much % risk will be used, either based on SL or Account equity
extern bool AutoLot = false;
extern bool AllowSecond = false;
extern int AdvancedProfitManagerBlackout = 60; // 60 minutes wait after the Advanced Profit Manager closes a trade
// First dailyEA1
extern string TRADING_DAYS1AM = "1,2,3,4,5";
extern int StopLossFirst1 = 600; // 0 deactivates Stop Loss
extern int StopLossSecond1 = 600;
extern int StartTrail1 = 300; // Start trail after so many pips.
extern int TrailingStop1 = 250; // 0 deactivates Trailing Stop
extern int TrailStep1 = 30; // With which increments TS moves
// Proportional stop
extern int PropStop1 = 1000; // PropStop follows behind current price by X pips
extern int StartPosition1 = 1650; // Pips profit at which to begin trailing with PropStop
extern double IncrementPercentage1 = 2; // Each pip of profit changes the PropStop value by X percent
extern int MinStopValue1 = 100; // PropStop cannot be less than X
extern int TakeProfit1 = 400; // 0 deactivates Take Profit
extern int GainForBE1 = 200; // How many pips will trigger Break Even. 0 deactivates.
extern int PipsBE1 = 20; // Level at which Break Even will be put
extern int StartTime1 = 130; // Start trading at 7:00
extern int StopTime1 = 1200; // Stop trading at 23:00; Set to StartTime for continous operation (default).
extern int PipGap1 = 100; // Pip gap between first and second entry
extern int TimeGap1 = 30; // Time gap between first and second entry of 30 min
extern int PipsLongEntry1 = -10;
extern int PipsShortEntry1 = 10;
extern string profit="==== Profit Manager ====";
extern int PMTP1 = 1650;
extern bool EnableExitManager = false;
extern double OldSwapLong = 1.0;
extern double OldSwapShort = -1.0;
extern int RangeDeviation = 100;


extern bool UseProbCountsFilter = true; //1 ea with high settings ,secon/forth /seventh/9 th with high settings on second and fourth strategy = msptifilter
extern bool UseProbCountsFilter2 = true;
extern bool UseMSSIFilter = false; // stoch4h
extern bool UsePriceFilter = false;
extern bool UseLWMAFilter = false;
extern bool UseMSEI601Filter = true; // total
extern bool UseConsolidationFilter = false; // oldpm
extern int MinimumPreviousRange = 2;
extern bool Disable_Comments = false; // EA will not display comments on screen
extern string closing="==== Close Times ====";
extern bool CloseOnTime = true;
extern int ClosingTime = 2000;
extern int FridayCloseHour = 19; // Close all pending and open orders on Friday 19.00 hours
extern datetime DisableFrom = D'2016.10.1 11:00:00'; // disable all new trades between 11.00am to 15.00 hours on 1/10/2008
extern datetime DisableTo = D'2016.10.1 15:00:00';
extern bool UseFILEilter = false;
//---- Debugging
extern bool DoScreenShots = true; // Makes screen shots when a trade is open

extern int ExpertID = 6667711;

extern bool UseAdvancedMM = true;//MARTIGALE

Link to comment


This topic is now archived and is closed to further replies.

  • General Statistics

    • Total Topics
    • Total Posts
    • Total Members
    • Most Online
      10/06/21 10:53

    Newest Member
    Joined 03/06/23 20:25
  • Posts

    • I don't know but it looks like a really awesome service Because I have come across all sorts of mixers in my work  
    • Charting the Markets: 2 June Indices rally as US agrees debt ceiling bill. EUR/USD, GBP/USD rally while EUR/GBP stabilises as US debt ceiling bill is passed. And WTI recoups recent losses while gold, silver on track for first weekly advance. Axel Rudolph FSTA | Senior Financial Analyst, London | Publication date: Friday 02 June 2023               This is here for you to catch up but if you have any ideas on markets or events you want us to relay to the TV team we’re more than happy to.
    • It was a blockbuster number yesterday for the ADP private payrolls, showing 278,000 jobs opened in May, while forecasts had been for 170,000.  Jeremy Naylor | Analyst, London | Publication date: Friday 02 June 2023 IGTV’s Jeremy Naylor suggests a similar upside surprise could see almost 300,000 jobs created under the non-farm payroll count with estimates for 190,000 job creations. The unemployment rate is seen rising one notch to 3.5%. (Video Transcript) NPFs: what to expect Could yesterday's strong private payrolls number from the ADP reading give us an insight into the potential upside risk to today's non-farm payrolls? That report from ADP yesterday showed 278,000 jobs opened in May - forecasts had been for 170,000. Now the NFP expectations, 190,000 job creations are forecast for the month of May proportionately using that ADP surprise. That would mean an upside reading for NFPs close to 300,000. Why the increase? Now, the unemployment rate is seen rising one notch to 3.5%. Why is that rising? When you've got that rise in the number of job creations, the unemployment rate is not taking the same data that the jobs numbers themselves are being produced from average hourly earnings. We're looking there for that to go up 0.3% month-on-month, 4.4% year-on-year, still below the rate of inflation. Now, this chart shows the unemployment rate back to pre-Covid-19 levels. It's clear that jobs have been created at an appreciable rate and this alongside a relatively strong GDP number and inflation coming down, there may yet be a soft landing for the US economy. But if the Federal Reserve (Fed) does continue to raise rates, things may get a little bit more sticky for the economy and a little bit more difficult to predict. This is a comparison of fed funds rates and US consumer price inflation (CPI) since January 2021. So you can see here the rate at which the US central bank has been piling the pressure on the monetary markets with that rise to five and a quarter percent. And at the same time, the CPI number is coming down, which is a good thing, but it's still not down to the 2% level, 4.9% is a long way away still from the 2% target. So the Fed is entitled still to have an excuse to raise interest rates. US dollar basket Let's take a look at what's been happening with the US dollar basket. Yesterday, we saw a pullback coming through as we saw money going into risk assets because of that rubber stamping from the Senate or the vote in the Senate to approve the budget that's now gone for the presidential seal. EUR/USD And we've seen a second day in a row of losses or the euro for the dollar basket as far as the euro/dollar is concerned, bouncing away from that 76.4% retracement. And I think now, you will have been stopped out if you were short on this, you would have been stopped out on this and hopefully you would have got some profits on the way down. So that's where things are ahead of non-farm payrolls out today at 13:30 UK time. And we will be live on the IG platform at 13:25 today.
  • Create New...