Firebird v63G - page 30

 

As you can see on the chart for the USDCHF for the last week Firebird is doing very well in a range bound market. As the markets becomes trending Firebird is very often making the wrong decisions. So the solution for this can be very simple: we have to get out as soon as the marker becomes trending and come back when the range bound market is restored.

In Phoenix there is a piece of code that's looking after these changes. In short it takes the Highs of the last 24, 12, 6 and 2 hours and can decide when the market becomes trending and when the range bound market is restored.

 

Excellant work Hendrick, your brainstorming is paying off, I'm looking forward to forward testing Phoenix when you release it. cheers, Goldensight

Hendrick:
Here you can see the difference in behaviour between Phoenix and Firebird for the USDCHF when things are getting rough:

Firebird was placing 3 BUYS, all stopped out.

Phoenix is waiting for the right moment, made 3 SELLS which all hit the TP.

Nice?
 
MarvinSk:
Getting alot closer now

I have added this:

if ((Safe1!=1)&&(DealTime==2)) {

for (int i=OrdersTotal()-1; i>=0; i--) {

if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {

if (OrderSymbol()==Symbol()) {

if (OrderType()==OP_BUY) {

pBid=MarketInfo(OrderSymbol(), MODE_BID);

OrderClose(OrderTicket(), OrderLots(), pBid, slip, clCloseBuy);

}

if (OrderType()==OP_SELL) {

pAsk=MarketInfo(OrderSymbol(), MODE_ASK);

OrderClose(OrderTicket(), OrderLots(), pAsk, slip, clCloseSell);

}

}

}

}

}

In a Back Test I see it closing the OpenTrades, but I need to add the STOPLOSS Lookup Feature, because Its closing trades that have POSITIVE GAINS, when the Safe1 and DealTime variables are matched....

So Stoploss has to be the 3rd trap... I will forward this next week once i get it working...

Again everyone is idea having some control over Existing open trades during when the Market becomes Volitile... If a Trade is going to STOP I rather it Stop Halfway rather than 100%. Atleast when the market recovers you dont have alot to make up...

Thanks

Hi Marvin,

A much easier solution will be to close an open trade as soon as the signal changes. What do you think?

 
Hendrick:
Hi Marvin, A much easier solution will be to close an open trade as soon as the signal changes. What do you think?

Hey Hendrick... When you say signal do you mean when Safe1 and Dealtime value become true?

If thats the case what I have seen from backtesting because the market is closed right now, is that some Postive Trades also got Closed out... So STOPLOSS checking is the 3rd variable to control that

I have some code presented By ELIHAYUN

Check this out Hendrick...

void CloseOrder(int ticket,double numLots,double close_price)

{

int CloseCnt, err;

// try to close 3 Times

CloseCnt = 0;

while (CloseCnt < 3)

{

if (OrderClose(ticket,numLots,close_price,Slippage,Violet))

{

CloseCnt = 3;

}

else

{

err=GetLastError();

Print(CloseCnt," Error closing order : (", err , ") " + ErrorDescription(err));

if (err > 0) CloseCnt++;

}

}

}

void CloseHalfSL()

{

double LosePercent = 50.0; // 50% from the S/L

for(int i=OrdersTotal()-1;i>=0;i--) // scan all orders and positions...

{

OrderSelect(i, SELECT_BY_POS, MODE_TRADES);

if (OrderMagicNumber() != MagicNumber) continue;

if ( OrderSymbol()==Symbol() )

if (OrderProfit() < 0) // we have loss trade

{

double prc = Bid;

if (OrderType() == OP_SELL) prc = Ask;

double ord_prc = OrderOpenPrice();

double ord_SL = OrderStopLoss();

int SL_points = MathAbs(ord_prc - ord_SL) / Point;

int Actual_Lose = MathAbs(prc - ord_prc) / Point;

if ( (Actual_Lose * 100 / SL_points) >= LosePercent) // Too much lose

{

CloseOrder(OrderTicket(), OrderLots(), prc);

}

}

}

}

/// ---- Check for not safe to trade then call CloseHalfSL

if (NotSafeToTrade) CloseHalfSL();

 
MarvinSk:
Getting alot closer now

I have added this:

if ((Safe1!=1)&&(DealTime==2)) {

for (int i=OrdersTotal()-1; i>=0; i--) {

if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {

if (OrderSymbol()==Symbol()) {

if (OrderType()==OP_BUY) {

pBid=MarketInfo(OrderSymbol(), MODE_BID);

OrderClose(OrderTicket(), OrderLots(), pBid, slip, clCloseBuy);

}

if (OrderType()==OP_SELL) {

pAsk=MarketInfo(OrderSymbol(), MODE_ASK);

OrderClose(OrderTicket(), OrderLots(), pAsk, slip, clCloseSell);

}

}

}

}

}

In a Back Test I see it closing the OpenTrades, but I need to add the STOPLOSS Lookup Feature, because Its closing trades that have POSITIVE GAINS, when the Safe1 and DealTime variables are matched....

So Stoploss has to be the 3rd trap... I will forward this next week once i get it working...

Again everyone is idea having some control over Existing open trades during when the Market becomes Volitile... If a Trade is going to STOP I rather it Stop Halfway rather than 100%. Atleast when the market recovers you dont have alot to make up...

Thanks

This might be a way to leave POSITIVE GAINS orders open. Add "&& OrderProfit()<0" in the if(OrderType()" line.

if ((Safe1!=1)&&(DealTime==2)) {

for (int i=OrdersTotal()-1; i>=0; i--) {

if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {

if (OrderSymbol()==Symbol()) {

if (OrderType()==OP_BUY && OrderProfit()<0) {

pBid=MarketInfo(OrderSymbol(), MODE_BID);

OrderClose(OrderTicket(), OrderLots(), pBid, slip, clCloseBuy);

}

if (OrderType()==OP_SELL && OrderProfit()<0) {

pAsk=MarketInfo(OrderSymbol(), MODE_ASK);

OrderClose(OrderTicket(), OrderLots(), pAsk, slip, clCloseSell);

}

}

}

}

}

Wackena

 
Wackena:
This might be a way to leave POSITIVE GAINS orders open. Add "&& OrderProfit()<0" in the if(OrderType()" line.

if ((Safe1!=1)&&(DealTime==2)) {

for (int i=OrdersTotal()-1; i>=0; i--) {

if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {

if (OrderSymbol()==Symbol()) {

if (OrderType()==OP_BUY && OrderProfit()<0) {

pBid=MarketInfo(OrderSymbol(), MODE_BID);

OrderClose(OrderTicket(), OrderLots(), pBid, slip, clCloseBuy);

}

if (OrderType()==OP_SELL && OrderProfit()<0) {

pAsk=MarketInfo(OrderSymbol(), MODE_ASK);

OrderClose(OrderTicket(), OrderLots(), pAsk, slip, clCloseSell);

}

}

}

}

}

Wackena

Wackena thanks.. but i made a correction to our syntax

double pBid, pAsk;

if ((Safe1!=1)&&(DealTime==2)) {

for (int i=OrdersTotal()-1; i>=0; i--) {

if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {

if (OrderSymbol()==Symbol()) {

if ((OrderType()==OP_BUY)&&(OrderProfit()<0)){

pBid=MarketInfo(OrderSymbol(), MODE_BID);

OrderClose(OrderTicket(), OrderLots(), pBid, slip, clCloseBuy);

}

if ((OrderType()==OP_SELL)&&(OrderProfit()<0)) {

pAsk=MarketInfo(OrderSymbol(), MODE_ASK);

OrderClose(OrderTicket(), OrderLots(), pAsk, slip, clCloseSell);

}

}

}

}

}

 

Ok all I am forward testing with the additions I made concerning the handling of existing open trades when the market is volitile...

The only exception i have is... Instead of TradingHour From 0 - 24

I am trading this pattern:

0 - 7 EST

11 - 24 EST

I am doing this because I want to make sure that the EA is explicitly not trading during when NY is opening... I have seen to much volitilty at 8 -10 EST

I will post my results as the week progresses... We have some noise maker news this week lets see what happens

 

I just finished reading the book "Bird Watching in Lion Country". It is not bad. The last chapter is useful. It is also quite relevant to the idea behind Firebird and Phoenix. The idea is not exactly the same but very similar and one can easily steal some good ideas from it and impliment them to further make Firebird into an awesome EA. If Hendrick, Wackena and the few other developers of Firebird are interested in reading it, let me know.

 

want to Test Firebird

Hi hendrik,.. I want to test the newers version of Fire Bird (because many version of firebird). can U show me please,....

hard work guys for developed fire bird to phoenix , I respect to all of you,...

Thank's

 

No problem with live account

MarvinSk:
Anyone has a LIVE Account with InterbankFX

I am getting these errors

2006.06.26 20:10:59 : order buy 1.00 USDCHFm opening at 1.2407 sl: 1.2307 tp: 1.2417 failed [Common error]

Does this mean they are not allowing EA on LIVE accounts??

I have a live account with IBFX, no problem so far...

Reason: