Raw Ideas - page 2

fab4x
83
fab4x  

Bartrader

I have this EA for MT3 and its simple design is to place 2 orders BUYSTOP and SELLSTOP.

Now its price is calculated from the previous bar info. The pivot value is generated and then add +17 for BUY and -13 for sell off that pivot value. If trade is executed then it should close at end of bar. If not then both are deleted at end of bar. Then it does the whole thing again.

I would use a breakeven to 0 after 10pips

Could someone take a look at this EA to make some changes to do this.

/*[[

Name := BARTRADER

Author := FAB4X

Link := http://www.FAB4X.com

Notes := Use on 15 or 30m charts

Lots := 1.00

Stop Loss := 45

Take Profit := 25

Trailing Stop := 0

]]*/

define: Slippage(5);

define: MM(0);

define: Risk(7.5);

var: cnt(0);

var: Opentrades(0);

var: lotsi(0);

var: trend("");

var: vTime(0);

var: vol1(0);

var: vol2(0);

var: myh(0),myl(0),myc(0),pivot(0),buyprice(0),sellprice(0);

//////////////////////////////////////////////////

// Exit if not H4 charts

//////////////////////////////////////////////////

/*

if Period != 240 then

{

Comment("This expert is for 4HR Charts");

Exit;

}

*/

//////////////////////////////////////////////////

// Exit if time between EA runs is less than 5 sec.

//////////////////////////////////////////////////

if Curtime - LastTradeTime < 5 then exit;

//////////////////////////////////////////////////

// Set if back tester earlier than 2005

//////////////////////////////////////////////////

If TimeYear(time)<2005 then Exit;

//////////////////////////////////////////////////

// Set Variables

//////////////////////////////////////////////////

Slippage = Slippage*Point;

myh=High[1];

myl=Low[1];

myC=Close[1];

Pivot = ( myh+myl+myc )/ 3 ;

buyprice=pivot+17*point;

sellprice=pivot-13*point;

//////////////////////////////////////////////////

// Set Comment

//////////////////////////////////////////////////

//////////////////////////////////////////////////

///////////// Manage multiple trades /////////////

//////////////////////////////////////////////////

Opentrades = 0;

for cnt = 1 to TotalTrades

{

If OrderValue(cnt,Val_Symbol) == Symbol then

{

Opentrades++;

}

};

//////////////////////////////////////////////////

///////////// Money Manager /////////////

//////////////////////////////////////////////////

if mm != 0 then Lotsi = Ceil(Balance*risk/10000)/10

else Lotsi=Lots;

//////////////////////////////////////////////////

// Close Order after each bar!

//////////////////////////////////////////////////

if Opentrades != 0 and vTime != Time[0] then

{

for cnt=1 to TotalTrades

{

If Ord(cnt,VAL_SYMBOL) == Symbol then

{

If (Ord(cnt,VAL_TYPE)=OP_BUY or Ord(cnt,VAL_TYPE)=OP_SELL) then

{

vTime = Time[0];

CloseOrder(OrderValue(cnt,VAL_TICKET),Ord(cnt,VAL_LOTS),(cnt,VAL_CLOSEPRICE),Slippage,BlueViolet);

// Exit;

}

If (Ord(cnt,VAL_TYPE)=OP_BUYSTOP or Ord(cnt,VAL_TYPE)=OP_SELLSTOP) then

{

vTime = Time[0];

DeleteOrder(OrderValue(cnt,VAL_TICKET),Brown);

// Exit;

}

}

}

}

//////////////////////////////////////////////////

// Open Trade at start of bar!

//////////////////////////////////////////////////

if Opentrades == 0 and vTime != Time[0] then

{

vTime = Time[0];

SetOrder(OP_BUYSTOP,Lotsi,buyprice,Slippage,buyprice-stoploss*point,buyprice+takeprofit*point,blue);

// Exit;

};

if Opentrades > 0 then

{

//vTime = Time[0];

SetOrder(OP_SELLSTOP,Lotsi,sellprice,Slippage,sellprice+stoploss*point,sellprice-takeprofit*point,Red);

// Exit;

}

exit;

Sergey Golubev
Moderator
119015
Sergey Golubev  

Flat indicators

Flat indicator. It works (see image) but sometimes. May anybody fix the errors there.

Files:
flat.gif 17 kb
flat.mq4 4 kb
Sergey Golubev
Moderator
119015
Sergey Golubev  

Trendlines and Divergence

All the indicators for the thread https://www.mql5.com/en/forum/173123 please post here.

Two indicators posted by alp.

Files:
fchaman
31
fchaman  

A new EA is requested...

Hi,

I am looking for an EA to do the following:

1- Use a daily chart only,

2- Identify the first major sup-res levels,

3- If the high-low of the closing daily bar is within any of the sup-res levels, then wait for the next closing daily bar,

4- Now we have two bars to deal with. If the breakout is on the support level, then look for a reversal pattern, and if found one, go long on the opening of the next daily bar. For sell signal, if any of the first two bars has hit the res level, and a reversal pattern is detected, then sell on the next daily bar. You figure out your tp-sl levels.

If anyone is interested, I have the code for the reversal patterns,

Thanks.

forexpipmaster
107
forexpipmaster  

EMA AngleZero

Is it possible to program the EMA Angle Zero right into another EA and make it part of that EA code , instead of having it work only like an indicator ??

George T

TraderSeven
210
TraderSeven  

Sharpe Ratio, Sortino Ratio , Rina Index etc

I'm looking for a tool that reads MT4 strategy tester reports and calculates Sharpe Ratio, Sortino Ratio, Rina Index or something similar

Even better would be if it can handle several reports from diffrents systems so I can calculate the portfolio ratio.

A nice graph wouldn't hurt either :-)

Can someone help me with a (URL to a) program that does all or part of the above?

I know it's a big request but I think knowing the ratio of your sytem/portfolio is, an often overlooked, important aspect of your system design.

Luis Santos
8
Luis Santos  

Trend Signal

To find the trend direction I use 2 MACD, one short and one long, and trade if both histograms are in the same direction.

Sometimes it is dificult to read the slope of the histogram, so I use a Stoch of the MACD hist. Chart attach pdf file.

I am new user of MT4 and don't know how to program,

Do you know were I can find a Stoch of the MACD hist.

Thank you

Files:
awt_print.pdf 68 kb
GBTrader
7
GBTrader  

Simple but powerful

Hi,

I'm not a programmer. Spent 6 months trying on MQL3 and then 4 comes along. So I'm back to nowhere! Please can anyone help with the following. It should help other beginners as well, as it is the basics. Here's what I need:

1. A MQL that use two EMA's with a buy or sell signal on the cross depending on direction.

2. The value of each must be set separately.

3. The close signal is set on the reverse cross over.

4. Must include a trailing stoploss.

I've had a look at codersguru's posts at https://www.mql5.com/en/forum/173171 and his code looks excellent, except that it subtracts 1 MA from the other. This is excellent, but deprives me of the abillity to work with each MA independently in the Expert properties fields.

Thanks Guys.

Great site.

m217irr
88
m217irr  

combination of ICWR indicator and THE TUNNEL METHOD

Hi ereryone

My experience in FX trading is not more so that I lost my deposit in my mini account in fibogroup broker, that is why I start to study hard in order to get a stable way to trade with minimum risk, in this forum I learn many things and I'm almost clear and find out basic matters, I think the combination of ICWR indicator and THE TUNNEL METHOD can make a stable strategy and if it is possible to convert it to Expert Advisor it maybe have good results, anyway I want to start real trading again, please tell me if you use an expert advisor that you yourself use in your real trading and has good results so that I can increase my deposit not to lose all of my deposit .

alp
195
alp  

Auto Regression Channel

Hi everyone,

I kindly ask programers to take a look at the code and, if possible, explain it in plain English:

at what moment of time does this indicator change direction?

That's it.

The following is totally unclear to me

The moment I write this message

GBPUSD M1 has 32785 bars of uptrend and that means almost 23 daily bars

M5 has 1525 bars of uptrend - 5.3 daily bars

M15 has 523 bars of uptrend -5.4 daily bars

whereas

M30 has 56 bars of downtrend - 1.16 daily bars

H1 has 21 bar of downtrend - almost 1 daily bar

and finally H4 has 68 bars of uptrend - means 11.3 daily bars.

D1 has 12 bars of uptrend

Question again: how is it possible that one minite bar chart counts 22 days of uptrending Cable and at the same time so drastically differs from H1 chart?

Thanks