open/close cross ea

User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: open/close cross ea

Post by SteveHopwood »

gaheitman wrote:Is it worth putting explicit deletes in when the bot closes trades on it's own?

Code: Select all

bool CloseTrade(int ticket)
{   
   while(IsTradeContextBusy()) Sleep(100);
   bool result = OrderClose(ticket, OrderLots(), OrderClosePrice(), 1000, CLR_NONE);

   //Actions when trade send succeeds
   if (result)
   {
      ObjectDelete(SlPrefix + DoubleToStr(ticket, 0));
      ObjectDelete(TpPrefix + DoubleToStr(ticket, 0));
      return(true);
   }//if (result)
   
   //Actions when trade send fails
   if (!result)
   {
      return(false);
   }//if (!result)
   

}//End bool CloseTrade(ticket)
BTW, quick work updating the code to make sure there were lines in the first place!

George


See if this works.

:D
Yes, it is. I was just being lazy.

:D
You do not have the required permissions to view the files attached to this post.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: open/close cross ea

Post by SteveHopwood »

jiva34 wrote:stop lines on chart are not aprobloem now.
But it looks like the stop reverse function is not always working.
screenshot shows 2 times a short did not open when a buy was stopped out on a reverse signal..
I knew what the problem is as soon as I read your post.

This should solve it.

:D
You do not have the required permissions to view the files attached to this post.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
tex
Trader
Posts: 89
Joined: Wed Nov 16, 2011 7:27 am

Re: open/close cross ea

Post by tex »

Jiva,

which MA settings do you use for this bot ?

thanks
jiva34 wrote:stop lines on chart are not aprobloem now.
But it looks like the stop reverse function is not always working.
screenshot shows 2 times a short did not open when a buy was stopped out on a reverse signal..
User avatar
jiva34
Trader
Posts: 49
Joined: Tue Nov 15, 2011 1:26 pm

Re: open/close cross ea

Post by jiva34 »

??????????????????
Am testing a number of settings.
Looks like 34, method 6 for the open/close cross
and a slower ma for the trend.
Looking at 144, method 2.
On a 15 minute chart for EURUSD.
no trailing stops, be 25 move, 5 pips
Basically whatever works...
User avatar
jiva34
Trader
Posts: 49
Joined: Tue Nov 15, 2011 1:26 pm

Re: open/close cross ea

Post by jiva34 »

SteveHopwood wrote:
jiva34 wrote:stop lines on chart are not aprobloem now.
But it looks like the stop reverse function is not always working.
screenshot shows 2 times a short did not open when a buy was stopped out on a reverse signal..
I knew what the problem is as soon as I read your post.

This should solve it.

:D
not opening trades at all........
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: open/close cross ea

Post by SteveHopwood »

jiva34 wrote:
SteveHopwood wrote:
jiva34 wrote:stop lines on chart are not aprobloem now.
But it looks like the stop reverse function is not always working.
screenshot shows 2 times a short did not open when a buy was stopped out on a reverse signal..
I knew what the problem is as soon as I read your post.

This should solve it.

:D
not opening trades at all........
No reason why it shouldn't - and it is in a backtest, both the initial trade and s&r.

:D
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
User avatar
jiva34
Trader
Posts: 49
Joined: Tue Nov 15, 2011 1:26 pm

Re: open/close cross ea

Post by jiva34 »

not opening anything..
settings are the same as for the previous version which did open and close
but didn't open the shorts when the buys stopped out.
??
User avatar
Gamma_gallus
Trader
Posts: 118
Joined: Wed Nov 16, 2011 2:03 pm
Location: France

Re: open/close cross ea

Post by Gamma_gallus »

I'm running an optimization with following variables (EURUSD M15).
I'll post the results in a couple of hours when it's done.
After I'll demo some of the different settings on a forward testing to assess the optimization quality (can't really rely on it - quite often)

FastMaPeriod
FastMaMethod
FastMaAppliedPrice
SlowMaPeriod
SlowMaMethod
SlowMaAppliedPrice
User avatar
gaheitman
Trader
Posts: 655
Joined: Tue Nov 15, 2011 10:55 pm
Location: Richmond, VA, US

Re: open/close cross ea

Post by gaheitman »

It's opening trades in ST for me as well. Are you downloading the one from the first post, it has a version 5 identifier.

George
jiva34 wrote:not opening anything..
settings are the same as for the previous version which did open and close
but didn't open the shorts when the buys stopped out.
??
User avatar
Gamma_gallus
Trader
Posts: 118
Joined: Wed Nov 16, 2011 2:03 pm
Location: France

Re: open/close cross ea

Post by Gamma_gallus »

Here attached the optimization file (EURUSD M15) variables are in red.
I'll test few versions, will see which ones over the weekend.
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “Automated trading systems”