MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal

Order MQL5 Programs from professional developers

Subscribe to signal
Forex Star
1 345.08%, 72 253.75 USD
Screenshot
USDJPY, D1
Demo
XdinMA Indicator
XdinMA
Author: GODZILLA
MOBYMOBY Try product
MOBY
Author: jaman
Interview with Antonio Morillas (ATC 2011) Interview with Antonio Morillas (ATC 2011)

Need EA for MQL5

To add comments, please log in or register
Miguelito Yap
456
fxyekim 2011.04.11 07:57

I have writtern this EA for MQL4 but I'm having a difficult time with MQL5. I need someone's help.

 

Inputs

TakeProfit, StopLoss (in pips)

TradingTimeFrame - the chart's period

   IndicatorBuffer - using the chart's timeframe, IndicatorParam1,IndicatorParam2,IndicatorParam3, I can add params if needed later

   Example:  iMACD(NULL,TradingTimeFrame,IndicatorParam1,IndicatorParam2,IndicatorParam3,PRICE_CLOSE,MODE_MAIN)

OtherTimeFrame - some other timeframe,

   OtherIndicatorBuffer - using the OtherPeriod's timeframe + OtherIndicatorParam1, OtherIndicatorParam2, OtherIndicatorParam3

MaxSpread (in pips) - if current spread is bigger, stop trading until spread is back to normal

Leverage - multiplier of Balance to get lots, example: Leverage 10, Balance 1000, should trade 10,000 or 0.1 lots

MaxSingleDayLossCount, example if set to 2, after 2 losing trades in the same day, trading should stop until next day

WaitInMinutes - after a trade has reached SL or TP, wait before placing another trade based on new signal, also wait for next order if trading multiple based on new signal

MultipleTrades - bool, true or false.  If true, will add to position in the same direction but must use WaitInMinutes and new Signal 

StartHour - start of trading for the week, Sunday at 17:00PST

StopHour - stop trading, close all open positions, Friday at 12:00PST (implicit, no trading on Saturday)

AllowClose - bool.  If true will close open positions based on opposite signals

 

OnInit

Write all parameters above to file, Symbols()+params.csv if not present

Read all parameters above to file, Symbols()+params.csv (useful because a recompile sets all params back to default)

If Optimizing or Testing, do not read nor write params files 

Set MagicNumber by converting Symbol() to number.

   for(int i=0;i<6;i++){
      MagicNumber += MathAbs(StringGetChar(Symbol(),i));
   }
 

OnTick

Alert if TradingTimeFrame != Period() and stop EA or just return(0)

Check dayofweek and hour of day use TimeLocal()

if Sat = no trading

if Sun and 17:00, start trading

if Fri and 12:00, stop trading and close all open positions

Signals: 

   bool TrendUp = OtherIndicator[0]>OtherIndicator[1]

   bool SignalUp = Indicator[0]>Indicator[1]

   bool TriggerUp =  Ask>Previous bars high, TradingTimeFrame or chart's Period()

   OpenBuy = TrendUp && SignalUp && TriggerUp

   OpenSell = TrendDn && SignalDn && TriggerDn (need 3 more bools opposite of Up bools)

   CloseBuy = OpenSell && AllowClose

   CloseSell = OpenBuy && AllowClose 

GetLots = Leverage * Balance (converted to lots)

GetLastClosedTradeTime - used with WaitInMInutes, I think this must be TimeCurrent()

GetLastOpenTradeTime - used with WaitInMinutes and Multiple, also TimeCurrent()

Trading:

   GetSignal

   check loss count (from history)

   check lots

   check wait and direction of open position if trading Multiple (GetLastOpenTradeTime)

   check wait with GetLastClosedTradeTime 

   SendOrders - market orders only, then modify to add SL and TP

     Symbol().Refresh after successfull send order. 

 

That's it for now, I think I got all my requirements in.  Let me know if you're interested and an estimate of cost.  I can give you snippets of my MQL4 code if you are chosen.

 

 

 

 

 

 

 

 

 

 

 

Job completed in 2 days. The portfolio of _Techno_ contains 520 finished jobs. This developer received 184 feedbacks with an average rate of 4.77.
Do you want to place a new order for _Techno_?
Nikolay Ivanov

_Techno_ 2011.04.11 08:36

I can perform this job.

It's my completed works : https://login.mql5.com/en/users/_Techno_/portfolio

To add comments, please log in or register