stevehopwoodforex.com
https://www.stevehopwoodforex.com/phpBB3/
Print view

Gann SQ9 EA
https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=476
Page 9 of 15
Author:  Kenboi [ Wed May 02, 2012 7:20 am ]
Post subject:  Re: Gann SQ9 EA

This Gann Indi is very powerful. If AG can dig in more and squeeze out more juice, then we will see a huge improvement. Good job, AG. Keep up the good effort.
Author:  AG2012 [ Wed May 02, 2012 8:30 pm ]
Post subject:  Re: Gann SQ9 EA

jjgengis wrote:hi AG,

first, thank you very much for this great EA and for all your efforts.

I would suggest a little modify, not substantial but useful.
I feel very uncomfortable when I use money instead of Pips in EA profit input. This because, if I want to change the lotsize, I'm forced to recalculate the Amount34/37 variables, if I want to keep unchanged the exits condition.
So, I wrote this simple modify:

Code: Select all

if (PipsOrBills)
        {
            if (Bid - OrderOpenPrice() >= Amount34 * PipValue * point)
            {
               ordticket[orders][0] = OrderOpenTime();
               ordticket[orders][1] = OrderTicket();
               orders++;
            }
        }    
        else
        {        
            if (OrderProfit() >= Amount34)
            {
               ordticket[orders][0] = OrderOpenTime();
               ordticket[orders][1] = OrderTicket();
               orders++;
            }
        }
PipsOrBills is an External Bool that switch your choice.

Thus , the closeorder function become so:

Code: Select all

void CloseOrderIf34()
{
    int orderstotal = OrdersTotal();
    int orders = 0;
    int ordticket[30][2];
    for (int i = 0; i < orderstotal; i++)
    {
        OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
        if (OrderType() != OP_BUY || OrderSymbol() != Symbol() || OrderMagicNumber() != 0)
        {
            continue;
        }
        if (PipsOrBills)  // ********************************JJ modify********************************
        {
            if (Bid - OrderOpenPrice() >= Amount34 * PipValue * Point)
            {
               ordticket[orders][0] = OrderOpenTime();
               ordticket[orders][1] = OrderTicket();
               orders++;
            }
        }    
        else
        {        
            if (OrderProfit() >= Amount34)
            {
               ordticket[orders][0] = OrderOpenTime();
               ordticket[orders][1] = OrderTicket();
               orders++;
            }
        }  // ********************************JJ modify********************************
    }
    if (orders > 1)
    {
        ArrayResize(ordticket,orders);
        ArraySort(ordticket);
    }
    for (i = 0; i < orders; i++)
    {
        if (OrderSelect(ordticket[i][1], SELECT_BY_TICKET) == true)
        {
            bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), 4, Red);
            if (ret == false)
            Print("OrderClose() error - ", ErrorDescription(GetLastError()));
        }
    }
    
}
for the Sell section (37) is enough change the row "if (Bid - OrderOpenPrice() >= Amount34 * PipValue * Point)" with "if (OrderOpenPrice() - Ask >= Amount37 * PipValue * Point)".

Is only a little suggestion.
:D

JJ
Hi JJgengis.
Thank you for your suggestion. Although I think that, this version will become obsolete very soon
as I'm working on using one of Steve's old EA's for this project (the 4.4).
I just need to have the indicator slightly modified.
Stay in touch... :D

AG
Author:  AG2012 [ Wed May 02, 2012 8:33 pm ]
Post subject:  Re: Gann SQ9 EA

Thanks for the praise Ken, but I think that everyone will be even happier, if I can get the indi modded to the way I prefer, so the "new" EA will be able to trade from it....

Cheers
Author:  Kenboi [ Wed May 02, 2012 8:59 pm ]
Post subject:  Re: Gann SQ9 EA

AG,

Take your time. I will always be here to support you by words. I am sorry that I am not a coder. Your work and effort are very appreciated by everyone in this thread.
AG2012 wrote:Thanks for the praise Ken, but I think that everyone will be even happier, if I can get the indi modded to the way I prefer, so the "new" EA will be able to trade from it....

Cheers
Author:  nkimandi [ Wed May 02, 2012 9:12 pm ]
Post subject:  Re: Gann SQ9 EA

Hi AG2012,pmacel,spybreak,billv and kenboi,

First off is to express gratitude for such a wonderful job being done especially by you with regard to
this EA.i have been following and boning up on gann and i use the gann hi lo activator indie actively so when in i read about the sq9 curiosity sonn too k over.

I have a query.I have thrown up this EA on several major pairs and cross pairs.The only changes i made to EA inputs was to put it on the recommended TF of H1(AG2012's tip),then modified the amount25 to be 25 and the amount 33 to be 25(billv's tip),i also changed the buy and sell lot to 0.02 from 0.03..BUT NO TRADES YET in the last 24 hours..is there something am missing or could have overlooked?..these were the only changes i have made to the EA input..can any of you Gann stalwarts advise me what to look at?

I will be most appreciative

Thanks so much too to Steve Hopwood for creating this wonderful and intense fx forum
Author:  nkimandi [ Wed May 02, 2012 9:14 pm ]
Post subject:  Re: Gann SQ9 EA

Hi AG2012,pmacel,spybreak,billv and kenboi,

First off is to express gratitude for such a wonderful job being done especially by you with regard to
this EA.i have been following and boning up on gann and i use the gann hi lo activator indie actively so when in i read about the sq9 curiosity sonn too k over.

I have a query.I have thrown up this EA on several major pairs and cross pairs.The only changes i made to EA inputs was to put it on the recommended TF of H1(AG2012's tip),then modified the amount25 to be 25 and the amount 33 to be 25(billv's tip),i also changed the buy and sell lot to 0.02 from 0.03..BUT NO TRADES YET in the last 24 hours..is there something am missing or could have overlooked?..these were the only changes i have made to the EA input..can any of you Gann stalwarts advise me what to look at?

I will be most appreciative

Thanks so much too to Steve Hopwood for creating this wonderful and intense fx forum
Author:  billv [ Thu May 03, 2012 1:41 am ]
Post subject:  Re: Gann SQ9 EA

nkimandi
The $25 TP figure which worked better in the backtests was only for lot size 0.03
If you change the lot size and/or currency you would need to find out the optimum TP figure.
Also, depends on your trading profile, I've started testing in a live account and I have lowered the TP figure to 20 because I want to exit the trades earlier.
cheers
Author:  Kenboi [ Thu May 03, 2012 8:03 am ]
Post subject:  Re: Gann SQ9 EA

nkimandi,

Look at the expert tab and see if there's any error. If not, try to load more pairs so that you can get your first trade for an experiment. I have about 17 pairs opened.
Author:  billv [ Thu May 03, 2012 11:10 am ]
Post subject:  Re: Gann SQ9 EA

nkimandi,
Don't expect trades straight away.
You'll need to have Empty4 running continuously for several days because it needs to build up the history file.
First you will see some red and blue lines on the charts and after that it will do a few trades when the conditions are right. It doesn't trade every day.
Author:  nkimandi [ Thu May 03, 2012 10:32 pm ]
Post subject:  Re: Gann SQ9 EA

billv wrote:nkimandi,
Don't expect trades straight away.
You'll need to have Empty4 running continuously for several days because it needs to build up the history file.
First you will see some red and blue lines on the charts and after that it will do a few trades when the conditions are right. It doesn't trade every day.
@billv...i have understood fully..i will do that and thanks a heap..one more question drawing from your own experience..once it has built up the history file and starts trading will there be need to have Empty4 continuosly running?
Kenboi wrote:nkimandi,

Look at the expert tab and see if there's any error. If not, try to load more pairs so that you can get your first trade for an experiment. I have about 17 pairs opened.


@kenboi..No errors showing up so far..i have loaded up 10 pairs namely GBPUSD,AUDUSD,NZDUSD,EURAUD,AUDJPY,GBPJPY, CADJPY,EURJPY,CHFJPY & USDCHF...i culled off these pairs using a rough thumb-of-estimation approach with regard to predictability of range trading,win/loss stats,net positive payoff that each one of them has displayed thus far..this one can get from spybreaks link that he so graciously has provided in page 6 of the forum...cheers man

@spybreak..which version of AGs handiwork are you using?

@spybreak& AG2012...the EAs performance is not to be sneezed at..a healthy profit factor handily exceeding 1.6,excellent sharpe ratio of below 0.3,low drawdown of 5%..such performance and its NOT a martingale strategy that will ultimately blow you apart!!..am keeping my fingers crossed on this daddy..cheers all!
All times are UTC Page 9 of 15