Hit and Run Scalper - page 2

 
stevegee58:
Sounds like this thread is fail and needs to be moved to "non-related discussions" or deleted.

I don't see any issue, Bongo has already stated that it doesn't work in a real account and it only works in demo (which is clearly does).

It is useful as a demonstration/educational EA to show how the backtester can be manipulated to achieve false results.

 

I used this EA on MT3, with some modification.

becman and steve, I dont think that you trade on Meta Trader 3!?

You are so newbies in this forum.

Maby I made some mistake to convert to MT4.

Bongo

 
Bongo:
I used this EA on MT3, with some modification.

becman and steve, I dont think that you trade on Meta Trader 3!?

You are so newbies in this forum.

Maby I made some mistake to convert to MT4.

Bongo

Bongo,

Clearly, we are lacking in the technical competence of your ability to code due to us joining the forum after you. Let's take a look at the code, and perhaps you can enlighten us on our inability to see what your clairvoyance is able to deduce on an alternate plane.

The code in question is in start(), which is executed on every tick , I have annotated each line with my comments

up_trend = curr_bid - old_ask;

down_trend = old_bid - curr_ask;

// thus, up_trend will be greater than 0 only when the Current Aid is bigger than previous Ask

// similarly, down_trend will be greater than 0 only when the Current Ask is smaller than the previous Bid

if (up_trend > 0.0) i = OrderSend(Symbol(),OP_BUY,Lotsi(),old_ask,0,Ask-StopLoss*Point,Ask+TakeProfit*Point,"Hit&Run",MagicNumber,0,Blue);

// When up_trend is > 0, issue a BUY order with the previous tick's Ask price

if (down_trend > 0.0) i = OrderSend(Symbol(),OP_SELL,Lotsi(),old_bid,0,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Hit&Run",MagicNumber,0,Red);

// When down_trend is > 0, issue a SELL order with the previous tick's Bid price

for (cnt = 0; cnt < OrdersTotal(); cnt++)

// Loops through all open orders

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if ((OrderMagicNumber() == MagicNumber) && (OrderSymbol() == Symbol()))

{

if (OrderType() == OP_BUY) i = OrderClose(OrderTicket(),OrderLots(),Bid,100,Blue);

// If Order is a BUY, close it with the Current Bid price

if (OrderType() == OP_SELL) i = OrderClose(OrderTicket(),OrderLots(),Ask,100,Red);

// If Order is a SELL, close it with the Current Ask price

}

}

// All trades should be closed by now

// Sets old_bid and old_ask to current prices so that they can be used in the next tick

old_bid = curr_bid;

old_ask = curr_ask;

Basically you open with the previous tick's Ask/Bid price and close with the current tick's Ask/Bid, and since it already knows both sets of prices, profit is guaranteed.

Do enlighten us on how this can work out with actual brokers. It is something we newbies can clearly not see.

 
beckham.is.619:
Bongo,

Clearly, we are lacking in the technical competence of your ability to code due to us joining the forum after you. Let's take a look at the code, and perhaps you can enlighten us on our inability to see what your clairvoyance is able to deduce on an alternate plane.

The code in question is in start(), which is executed on every tick , I have annotated each line with my comments

up_trend = curr_bid - old_ask;

down_trend = old_bid - curr_ask;

// thus, up_trend will be greater than 0 only when the Current Aid is bigger than previous Ask

// similarly, down_trend will be greater than 0 only when the Current Ask is smaller than the previous Bid

if (up_trend > 0.0) i = OrderSend(Symbol(),OP_BUY,Lotsi(),old_ask,0,Ask-StopLoss*Point,Ask+TakeProfit*Point,"Hit&Run",MagicNumber,0,Blue);

// When up_trend is > 0, issue a BUY order with the previous tick's Ask price

if (down_trend > 0.0) i = OrderSend(Symbol(),OP_SELL,Lotsi(),old_bid,0,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Hit&Run",MagicNumber,0,Red);

// When down_trend is > 0, issue a SELL order with the previous tick's Bid price

for (cnt = 0; cnt < OrdersTotal(); cnt++)

// Loops through all open orders

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if ((OrderMagicNumber() == MagicNumber) && (OrderSymbol() == Symbol()))

{

if (OrderType() == OP_BUY) i = OrderClose(OrderTicket(),OrderLots(),Bid,100,Blue);

// If Order is a BUY, close it with the Current Bid price

if (OrderType() == OP_SELL) i = OrderClose(OrderTicket(),OrderLots(),Ask,100,Red);

// If Order is a SELL, close it with the Current Ask price

}

}

// All trades should be closed by now

// Sets old_bid and old_ask to current prices so that they can be used in the next tick

old_bid = curr_bid;

old_ask = curr_ask;

Basically you open with the previous tick's Ask/Bid price and close with the current tick's Ask/Bid, and since it already knows both sets of prices, profit is guaranteed.

Do enlighten us on how this can work out with actual brokers. It is something we newbies can clearly not see.

You are right, profit is guaranteed.

Some ECN brokers are not care what price your EA is asking,

they are only passing your order thought MT4 to the banks.

 
beckham.is.619:
Bongo,

Clearly, we are lacking in the technical competence of your ability to code due to us joining the forum after you. Let's take a look at the code, and perhaps you can enlighten us on our inability to see what your clairvoyance is able to deduce on an alternate plane.

The code in question is in start(), which is executed on every tick , I have annotated each line with my comments

up_trend = curr_bid - old_ask;

down_trend = old_bid - curr_ask;

// thus, up_trend will be greater than 0 only when the Current Aid is bigger than previous Ask

// similarly, down_trend will be greater than 0 only when the Current Ask is smaller than the previous Bid

if (up_trend > 0.0) i = OrderSend(Symbol(),OP_BUY,Lotsi(),old_ask,0,Ask-StopLoss*Point,Ask+TakeProfit*Point,"Hit&Run",MagicNumber,0,Blue);

// When up_trend is > 0, issue a BUY order with the previous tick's Ask price

if (down_trend > 0.0) i = OrderSend(Symbol(),OP_SELL,Lotsi(),old_bid,0,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Hit&Run",MagicNumber,0,Red);

// When down_trend is > 0, issue a SELL order with the previous tick's Bid price

for (cnt = 0; cnt < OrdersTotal(); cnt++)

// Loops through all open orders

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if ((OrderMagicNumber() == MagicNumber) && (OrderSymbol() == Symbol()))

{

if (OrderType() == OP_BUY) i = OrderClose(OrderTicket(),OrderLots(),Bid,100,Blue);

// If Order is a BUY, close it with the Current Bid price

if (OrderType() == OP_SELL) i = OrderClose(OrderTicket(),OrderLots(),Ask,100,Red);

// If Order is a SELL, close it with the Current Ask price

}

}

// All trades should be closed by now

// Sets old_bid and old_ask to current prices so that they can be used in the next tick

old_bid = curr_bid;

old_ask = curr_ask;

Basically you open with the previous tick's Ask/Bid price and close with the current tick's Ask/Bid, and since it already knows both sets of prices, profit is guaranteed.

Do enlighten us on how this can work out with actual brokers. It is something we newbies can clearly not see.

Come on...why don't we spend our time in something that work, not in this proved failed expert...

Well, just my taughts...

 
leomzi:
Come on...why don't we spend our time in something that work, not in this proved failed expert... Well, just my taughts...

Nobody push you to waste your time.

This forum has 25,000 members, If we put our brains together,

I'm sure we can develope an EA that will works.

But I thing your brain is empty?

Bongo

 
Bongo:
Nobody push you to waste your time.

This forum has 25,000 members, If we put our brains together,

I'm sure we can develope an EA that will works.

But I thing your brain is empty?

Bongo

Wow, someone needs to go easier on cafeine

like i said bongo...it's just my taughts, and if my brain is empty or not...well that's my problem.

Enough of BS...

What's the reason of OrderSend error 138?, i was looking at the codes and didn't figure out how to fix it.

 
leomzi:
What's the reason of OrderSend error 138?,

138 is a requote on a market order. The OrderSend is doing a market order where the entry price specified is different from the current market price.

Here's the help for the OrderSend function:

"At opening of a market order (OP_SELL or OP_BUY), only the latest prices of Bid (for selling) or Ask (for buying) can be used as open price. If operation is performed with a security differing from the current one, the MarketInfo() function must be used with MODE_BID or MODE_ASK parameter for the latest quotes for this security to be obtained. Calculated or unnormalized price cannot be applied. If there has not been the requested open price in the price thread or it has not been normalized according to the amount of digits after decimal point, the error 129 (ERR_INVALID_PRICE) will be generated. If the requested open price is fully out of date, the error 138 (ERR_REQUOTE) will be generated independently on the slippage parameter. If the requested price is out of date, but present in the thread, the position will be opened at the current price and only if the current price lies within the range of price+-slippage."

 
leomzi:
Wow, someone needs to go easier on cafeine

like i said bongo...it's just my taughts, and if my brain is empty or not...well that's my problem.

Enough of BS...

What's the reason of OrderSend error 138?, i was looking at the codes and didn't figure out how to fix it.

From Error codes - MQL4 Documentation

ERR_REQUOTE 138 Requote.

You wouldn't expect the broker to accept a price based on the previous tick, would you?

 
leomzi:
Wow, someone needs to go easier on cafeine

like i said bongo...it's just my taughts, and if my brain is empty or not...well that's my problem.

Enough of BS...

What's the reason of OrderSend error 138?, i was looking at the codes and didn't figure out how to fix it.

Which broker are u using?

Please keep BS for yourself!

Bongo

Reason: