Profit Generator EA - page 13

 
jojolalpin:
I don't like to have orders with no SL or no TP and when using superclose(), there is no TP untill Trailing be activated. So I ask why not set an initial takeprofit (before superclose set one) to be secured in case of computercrash. That's why I proposed two times the value of takeprofit variable.

Also to initiate on the test plan, parameters are:

Stoploss: 10 to 30?

Takeprofit: 20 to 100?

TimeFrames: M1 M15 H4 Daily Weekly..

Currencies: 12 from Holyguy7 selection? only those with a little spread (<=5)?

those are just suggestions.

Ok, I see what you mean now. It's fairly easy to do. I use a dedicated server with 100% up time, so i neglect to think about things like that.

And here are some notes on the superclose(). I was hoping to be able to have the ability to track TS prices by the ticket number, so you can set MaxTrades to more than 1 AND be able to trail by less than 10 pips.

void SuperClose(){

for(int i=0;i<OrdersTotal();i++){

if(OrderSelect(i,SELECT_BY_POS)){

if(OrderSymbol()==Symbol() && OrderMagicNumber()==ID){//Pulls in order that meets the criteria for processing

int num=0;int pos=0;

for(int b=0;b<21;b++){// this (loopB) compares the ticket# of the selected order against the number stored in the ticket array

if(tsTicket==OrderTicket() ){

num++; pos=b;// if ticket numbers match, pos is the position in the array where the trailing data is stored

Print("(",pos,") Ticket ",tsTicket[pos]," found. SL is ",tsPrice[pos]);

break;

}

}

if(num==0){ // if the loopB did not find a matching ticket number it is time to initialize the data

for(int j=0;j<21;j++){

if(tsTicket[j]==0){// this is looking for the earliest instance within the array to store the data

pos=j;

break;

}

}

tsTicket[pos]=OrderTicket();// setting the ticket number

tsok[pos]=false;// this is to determine when trailing kicks in

Print("(",pos,") New ticket initialized = ",tsTicket[pos]);

}

if (OrderType()==OP_SELL) {

if (!tsok[pos] && (OrderOpenPrice()-Ask>=TSactivation*Point || TSactivation==0 ) ) {// if the trailing factor is false, but it has hit the activation point continue

tsPrice[pos]=Ask+TrailPips*Point;// this is the new trailinf stop price

tsok[pos]=true;// it's ok to proceed with trailing stop

if(TrailPips>8){// if this distance from the current price to the new stop, then modify the order.

ModifyStopLoss(Ask+TrailPips*Point);//modifies order

}

}

if (tsok[pos] && Ask+TrailPips*Point < tsPrice[pos] ){//if the position is gaining in profit

tsPrice[pos]=Ask+TrailPips*Point;

if(TrailPips>8){

ModifyStopLoss(Ask+TrailPips*Point);

}

}

if (tsok[pos] && Ask >= tsPrice[pos] ){// if the postion hits the stop price

CloseOrder(2);

Print("Order ",tsTicket[pos]," Closed from TS");

}

}

if (OrderType()==OP_BUY) {// reverse of SELL

if(!tsok[pos] && (Bid-OrderOpenPrice() >= TSactivation*Point || TSactivation==0 ) ) {

tsPrice[pos]=Bid-TrailPips*Point;

tsok[pos]=true;

if(TrailPips>8){

ModifyStopLoss(Bid-TrailPips*Point);

}

}

if (tsok[pos] && Bid-TrailPips*Point > tsPrice[pos] ){

tsPrice[pos]=Bid-TrailPips*Point;

if(TrailPips > 8){

ModifyStopLoss(Bid-TrailPips*Point);

}

}

if (tsok[pos] && Bid <= tsPrice[pos] ){

CloseOrder(1);

Print("Order ",tsTicket[pos]," Closed from TS");

} } } } }

for(i=0;i<21;i++){// this searches the array for ticket numbers that are now obsolete due to an order that has closed

if(tsTicket>0){

bool found=false;

for(b=0;b<OrdersTotal();b++){

OrderSelect(b,SELECT_BY_POS);

if(tsTicket==OrderTicket()){

found=true;

break;

}

}

if(!found){// if there are matching ticket numbers in the trade pool and the array then nothing happens

tsTicket=0;tsPrice=0;tsok=false;// if there is an obolete ticket the the data is reset. And the next new ticket data can occupy this space

Print("Array pos ",i," Cleaned");

} } } }
 
 

Here is the EA with change to the TP after UseClose is true. It will double the TP for safety purposes. Thanks Jo!

 
dazminder:
I was hoping to test out Profit Generator 2.4. It has not placed any trades from 630GMT.....Has it been placing anyother trades for anyone. TF15 $/CHT, £/$, Euro/$.. Please let me know, as I think this is a good EA in principal.

You will get less trades because the first criteria is that the present bar has to be greater than the value of LongBar in length. I would recommend a smaller candle on the lower TF.

 
jojolalpin:
ok, but as a newbie I'll wait for someone more experienced to give high and low limits to different parameters.

I'm currently testing 2.4 on presets from Holyguy7 and from 1:00 AM I only made 3 trades (1:10 sell usdcad on daily BAD; 7:29 and 14:29 gbpusd on H1 first 28 pips and second actually loser). It seems to be normal, anyone have same results?

Also, to allow multiple timeframes tests, I changed three lines on 2.6 version:

1 -

extern int ID;

becomes

extern int ID_BASE=100000; to give a number to PG_2.6 (here 1)

2 - I added next line just under "int Bar;"

int ID;

3 - I added init() function

int init(){

ID=ID_BASE+Period(); return(0);

}

So on a Daily chart magicnumber will be 101440 and will appear on trade's comment. It will be easier to analyse results for each timeframe and kind of parameters. I didn't test it yet but it should work.

and for a specific chart you will have a fixed ID and not a random number.

Also, maybe we could add a initial takeprofit using superclose function. Just in case of computer crash.

PS: I made other changes that I must delete before posting. tell me if interested.

Great idea! The only thing to keep in mind is if you are going to run different tests on the same pair and TF to change the Base ID. I added those changes, but made one small alteration. ...because the Period can can change from the variable "period" (different from chart), I did this instead:ID=ID_BASE+P(); return(0);

The P() returns the actual period in use by the program. Great idea...what other changes have you played with?

Here is 2.6.2.

 

nothing more since last post about this (gbpusd still loser) but i'm running on H1 and daily and I kept longbar=15.

let's wait this night (overall for jpy pairs)

 

anyone to suggest me testing parameters (SL & TP)?

I will use no hours limit on main currencies and M1, M5, M15, H1 and H4.

 
jojolalpin:
nothing more since last post about this (gbpusd still loser) but i'm running on H1 and daily and I kept longbar=15. let's wait this night (overall for jpy pairs)

I have noticed that the GBPUSD seems to work better on the Daily chart:

TP: 40

SL: 30

No Timefilter

Longbar: 10

Just seems more reliable. EURUSD and USDCHF seem to do better on the H1 chart with longbar at 15 and timefliter on.

I am struggling right now as the major currency pairs are giving me fits with this EA. Anybody been successful on the major currency pairs??? If so, please post your findings.

 

Hi

HolyGUY,

What is the progress today on this new EA

 
kumawat:
Hi

HolyGUY,

What is the progress today on this new EA

Well, there was some retracement from yesterday on because of some of the major currency pairs. Still up over 20% for the week and currently the system has NO open trades.

I will post my results in a few hours. I had the GBPUSD on the H1 timeframe but believe it is more reliable on the D1 timeframe as the others are. I will keep you posted.