Gogetter EA - page 2

 
Maji:
Truthfully, I am not sure if I can help you there. First because I have to spend time to do it, and that is right now at a squeeze for me. Second because till now I let the "indicators" do all the drawings and have never used EAs to do it. It is possible and I think the theory is the same.

I believe Codersguru had written a chapter on drawing lines, arrows etc. Try to read it up

Again, copying and pasting still requires you to understand what you are doing. Nothing like self help and you are proving that point very well. Keep up the hard work.

ok, you got me, I'll accept some credit for hard work. TGIF!! I've been an obcessed man with this. I deserve a break.

The thing with the drawing using indicators...I don't really care HOW it's accomplished (to a point) just that it IS accomplished...If an indicator can be made that puts arrows on the chart for opens and closes I suppose that would work too...I find that my live account draws everything in the tester all by itself without me telling it to do anything...my demo account on the other hand ...has issues

I'm more concerned with the multiple trade timing...does that improve if I use 'tick mode' ? I've been watching this in forward test and it does one trade per bar, that can put trades quite a ways apart pip wise AFTER the signal. If I'm gonna open 5 positions on a signal I want it to be ON the signal not spread out over half an hour after the signal...(rolleyes)

 

Build 1.01 -longs

This has one signal I've worked over a little that works. There are now some differences with the gogetshorts with the moving averages used and some of the signal logic...I pulled the signal off the original gogetter that was working on longs and played with it a little more.

This likes the GPB/USD 5mTF best. It pretty much crashes on the other time frames.

enjoy, please post your results/problems etc.

Files:
 
eric79:
Hi Congratulations for the nice looking curve. I think one thing that could be improved is the modelling quality of the test. 90% would be better.

I get very close to that on the GGs 2.11

I'm not used to using the version and build numbers...being this is my first venture...That was added by Graham from the factoid forum...it's one more thing to keep track of....these should have the current build and version numbers in the the chart window now... same logics and code just better cosmetics.

I'm letting them both run forward test in demo while we work on improvements.

 

I would still like to develop additional entry signals and parameters within these...

 

I find it really wierd when somthing works one day and doesn't work the next and I havn't made any changes that I can see...

my EA in the strategy tester now is NOT responding when I change the 'maxopentrade' setting...it uses two trades no matter what, if I tell it '0' it still uses two trades...it was working fine earlier even today and now suddenly it's decided that it's going to allow two open trades all the time no matter what I tell it....

last week if it told it to allow 5 trades at once it allowed 5 trades at once and when I told it to allow 1 trade at once it allowed one trade once.... I've SEEN it work!

Now I can't make it work to save me. what gives?

I thought perhaps I had lost a parenthesis or something on the if MaxOpenTrade line...

TradeSettings();

if (StopLossMode) StopLossLevel = Ask - StopLoss * Point; else StopLossLevel = 0.0;

if (TakeProfitMode) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0;

if(OrdersTotal() < MaxOpenTrade)

Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);

if(Ticket > 0) {

if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {

Print("BUY order opened : ", OrderOpenPrice());

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy");

} else {

Print("Error opening BUY order : ", GetLastError());

}

}

if (EachTickMode) TickCheck = True;

if (!EachTickMode) BarCount = Bars;

return(0); [/PHP]

so I changed it to this...

[PHP] TradeSettings();

if (StopLossMode) StopLossLevel = Ask - StopLoss * Point; else StopLossLevel = 0.0;

if (TakeProfitMode) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0;

if(OrdersTotal() < MaxOpenTrade){

Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);

if(Ticket > 0) {

if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {

Print("BUY order opened : ", OrderOpenPrice());

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy");

} else {

Print("Error opening BUY order : ", GetLastError());

}

}

}

if (EachTickMode) TickCheck = True;

if (!EachTickMode) BarCount = Bars;

return(0);

no improvement, it's still ignoring the MaxOpenTrade control.

ok it helps if I keep track of which signal of the two I'm changing....lol if I'm only using signal #2 and changing the setting on signal #1 that makes sense huh?

yea I AM losing my marbles.

 
for (int o = 0; o <= MaxOpenTrade; o ++)

Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);

if(Ticket > 0) {

if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {

Print("BUY order opened : ", OrderOpenPrice());

if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy");

return(0);

what this doesn't do is modify the orders at the same time... I guess I need to do something similar with the order modify function so they all modify at the same times too...

 

I am not sure, but I don't think it is the right way to do what you want to do.

Use the following function:

int CountTrades()

{

int count=0;

int trade;

for(trade=OrdersTotal()-1;trade>=0;trade--)

{

OrderSelect(trade,SELECT_BY_POS,MODE_TRADES);

if(OrderSymbol()!=Symbol()||OrderMagicNumber()!=MagicNumber)

continue;

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

if((OrderType()==OP_SELL) || (OrderType()==OP_BUY))

count++;

}//for

return(count);

}

Now call it in your program as

if CountTrades<MaxTrades then....

Also, get rid of that habit of counting up in a "for" loop and use a count down style. It will be useful when you are trying to close trades and in general will result in a more consistent coding style.

Good luck.

 

ok I did that, I updated everything in the GGlongs Ea with the CountTrades() even the previous CloseAll() thing you did earlier which was using the OrdersTotal()...So EVERYTHING in this particular build is now counting down instead of counting up I call that function alot.

EA now seems to work ok to open multiple orders at the same time and to s/l them or t/p them at the same time...

modifying them on the other hand....that's irratic and doesn't modify them all at the same time...

for (int t = 0; t < MaxOpenTrade; t ++)

if(CountTrades() < MaxOpenTrade)

OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);

return(0);

if (!EachTickMode) BarCount = Bars;

[/PHP]

something about this doesn't work right...however when I do this although it becomes crazy it ends up being more profitable...

this is the code for the 'altered' version that corresponds to the test reports below...when it's like this basically it doesn't modify anything at all....

//Trailing stop for long position

if(TrailingStopMode && TrailingStop > 0) {

if(Bid - OrderOpenPrice() > Point * TrailingStop || OrderOpenPrice() - Bid >= 0) { //below trigger the Ilevel==Ask

if(OrderStopLoss() < Bid - Point * TrailingStop || OrderStopLoss() == 0) {

for (int t = 0; t < MaxOpenTrade; t ++)

if(CountTrades() < MaxOpenTrade)

OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);

return(0);

if (!EachTickMode) BarCount = Bars;

TrailingStopMode = False; //resets mode after each order

StopLossMode = False; //resets mode after each order

continue;

this is the code that corresponds to the 'unaltered' reports below... This modifys but not as I imagine it should doing them all at the same time....

[PHP]//Trailing stop for long position

if(TrailingStopMode && TrailingStop > 0) {

if(Bid - OrderOpenPrice() > Point * TrailingStop || OrderOpenPrice() - Bid >= 0) { //below trigger the Ilevel==Ask

if(OrderStopLoss() < Bid - Point * TrailingStop || OrderStopLoss() == 0) {

//for (int t = 0; t < MaxOpenTrade; t ++)

//if(CountTrades() < MaxOpenTrade)

OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);

//return(0);

if (!EachTickMode) BarCount = Bars;

TrailingStopMode = False; //resets mode after each order

StopLossMode = False; //resets mode after each order

continue;

while I don't like how this is modifying according to the report it nonetheless is alot more profitable....

I'd like to be able to control the modifying to do it how i want it to just to know i can. maybe in the end it's better left this way but I want to know how to make it modify them all at the same time like it is doing with the opening and closings.

 

Now now now... you have come so far... so think hard... you have the counttrades code, so why not modify it to do the order modify stuff... something like this...

int ModifyTrades()

{

int trade;

for(trade=OrdersTotal()-1;trade>=0;trade--)

{

OrderSelect(trade,SELECT_BY_POS,MODE_TRADES);

if(OrderSymbol()!=Symbol()||OrderMagicNumber()!=MagicNumber)

continue;

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

OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen); /etc.

}//for

}

You got the basics down, and now it is upto you to figure out the rest.

Good Luck.

 
Maji:
Now now now... you have come so far... so think hard... you have the counttrades code, so why not modify it to do the order modify stuff... something like this...

int ModifyTrades()

{

int trade;

for(trade=OrdersTotal()-1;trade>=0;trade--)

{

OrderSelect(trade,SELECT_BY_POS,MODE_TRADES);

if(OrderSymbol()!=Symbol()||OrderMagicNumber()!=MagicNumber)

continue;

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

OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen); /etc.

}//for

}

You got the basics down, and now it is upto you to figure out the rest.

Good Luck.

that works...see attached...

the .htm file was too large to upload...suffice it to say that it does modify each order counting down at the same time....it's even resonably profitable not bad for this ruddy signal.

Files:
Reason: