Coin-Flip EA v2.0

Post Reply
zhengzuodong
Trader
Posts: 59
Joined: Sat Aug 02, 2014 8:38 am

Coin-Flip EA v2.0

Post by zhengzuodong »

enjoyforex » Thu Aug 07, 2014 10:45 am wrote:
zhengzuodong » Wed Aug 06, 2014 8:56 am wrote:
Hi patmontes,
To try this...Version2.20
1. Fix yesterday High / Low
2. Fixed stop loss setting not suited four and five brokers, as well as conflicts with automatic calculation of the Lots.

Please give me your suggestions
Post 2 updated
hi zhengzuodong, thank you for flip Coin EA, i read the original Thread on ff, interesting trading system :)

Will be nice if add this optional on External Setting :

1. Use ATR, Jysticim test say more profit that original version
2. Murrey Math Level : to decide Buy or Sell, increase Win Ratio
3. No Trade on Friday
4. TP using Yesterday High / Low Candle
5. ECN Broker Compatible

Best Regard

EF
Thanks, EF.
Sorry, I would also like to learn how to properly use the ATR and Murrey Math in the strategy.
3.and 4. should be easy to implement.
enjoyforex
Trader
Posts: 13
Joined: Wed Aug 06, 2014 1:12 am

Coin-Flip EA v2.0

Post by enjoyforex »

zhengzuodong » Thu Aug 07, 2014 3:26 am wrote: Thanks, EF.
Sorry, I would also like to learn how to properly use the ATR and Murrey Math in the strategy.
3.and 4. should be easy to implement.
maybe we should PM Jysticim & victor_ray to ask how to implement :mrgreen:

and if steve hopwood to help improve this EA will be great...stev, we need you in here :xm:
zhengzuodong
Trader
Posts: 59
Joined: Sat Aug 02, 2014 8:38 am

Coin-Flip EA v2.0

Post by zhengzuodong »

enjoyforex » Thu Aug 07, 2014 11:48 am wrote:
zhengzuodong » Thu Aug 07, 2014 3:26 am wrote: Thanks, EF.
Sorry, I would also like to learn how to properly use the ATR and Murrey Math in the strategy.
3.and 4. should be easy to implement.
maybe we should PM Jysticim & victor_ray to ask how to implement :mrgreen:

and if steve hopwood to help improve this EA will be great...stev, we need you in here :xm:
Right.

Right.
Maybe Steve, Tommaso and other programming expert can help us
xmess7
Trader
Posts: 32
Joined: Mon Oct 15, 2012 6:51 pm

Coin-Flip EA v2.0

Post by xmess7 »

Hello everyone, Hey zhengzuodong great job on the EA and thanks for the effort.

I ran the EA last nite and it took several trades on the 1st Hour candle after London. It should not do that, right? So, I took a look at the code and I saw what the problem might be. I changed it in my copy and it is working. But if you get a chance you might want to updated the official copy.

I recommend to change the following lines of code
FROM:

Code: Select all

 
int    i, ExistOrderFlag;
int    LondonOpenBarShift, pre_LondonOpenBarShift;
TO:

Code: Select all

 
static int  ExistOrderFlag;
int         i, LondonOpenBarShift, pre_LondonOpenBarShift;
By setting the varaible ExistOrderFlag as static you are assured that when the next tick comes the code will not reset it to 0. It will "remember" the last value of ExistOrderFlag until you restart the EA.

I also added a HardTP and TradeCandle inputs to my copy. If you are interested I can send you the code and explanations for what the new inputs mean and do.

If I have time (busy with other projects :) ) I will add the ATR and MURRAY conditions... I will do the ATR 1st that is fairly easy to do, but I didn't catch the idea behind the MURRAY condition... I'll look for it in the thread.

Take care all...
Jess
xmess777@yahoo.com
xmess7
Trader
Posts: 32
Joined: Mon Oct 15, 2012 6:51 pm

ATR implementation for Coin-Flip EA

Post by xmess7 »

zhengzuodong:

I made this off the top of my head. So it will need to be tested. But this would be my 1st attempt at integrating the use of ATR for SL.

Please make any corrections you see fit. Again, if interested, I can send you my copy which will have the HardTP added to it with the ATR recalculation as well.

According to the forum the ATR can be used to provide the following:
SL= 1/2 ATR
I will assume a period of 14 days, I couldn't find where period is specified.

-----------So here are the additions that I would make to the code----------------

Declare and add in Init() function new variable pointz, that takes care of both 3 and 5 digit brokers, will be used later.

Code: Select all

double pointz;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
  pointz=Point;
  if (Digits==3 || Digits==5) pointz = 10 * pointz;
    //---
   return(INIT_SUCCEEDED);
  }


Add variable Use_ATR to input section

Code: Select all

extern double EquityPercent = 0.2;
extern bool   Use_ATR       = true;  // If set true then HardSL and HardTP are calculated using ATR                
extern double HardSL        = 45.0;
Add calculation of SL based on ATR right before checking for 1st Candle:

Code: Select all

//+--------- if 'Use_ATR' is true then use 1/2 ATR as SL----------------
     if(Use_ATR) {
     HardSL=(iATR(Symbol(),PERIOD_D1,14,0)/pointz)*0.5;
     }

//+------Open a order at end of 1th h1 bar(or start of 2th h1 bar)
  if(TimeHour(TimeCurrent())==TimeHour(LOTinBroker)+1) 
I looked into the Murray approach but it was not clear on how to use it. Based on what I saw, looks like the author is going long if price is above the pivot and short if price is below. Is that corrrect?

I'll implement the ATR feature on my copy and test it later on.

Hope this helps... take care
Jess
xmess777@yahoo.com
zhengzuodong
Trader
Posts: 59
Joined: Sat Aug 02, 2014 8:38 am

Coin-Flip EA v2.0

Post by zhengzuodong »

Thank you for your efforts and contributions, Xmess7.
Please give me your copy, I have to learn and continue to improve him.
Thank you.
xmess7
Trader
Posts: 32
Joined: Mon Oct 15, 2012 6:51 pm

Coin-Flip EA v2.0

Post by xmess7 »

No problem zhengzuodong. Are you interested in the copy with both the HardSL and HardTP? Or do you just want to copy that contains just the use of HardSL. Let me know.

BTW, I tested the ATR and verified it. It works. The SL will now take on 1/2 ATR. :).
enjoyforex
Trader
Posts: 13
Joined: Wed Aug 06, 2014 1:12 am

Coin-Flip EA v2.0

Post by enjoyforex »

xmess7 » Fri Aug 08, 2014 3:30 am wrote:No problem zhengzuodong. Are you interested in the copy with both the HardSL and HardTP? Or do you just want to copy that contains just the use of HardSL. Let me know.

BTW, I tested the ATR and verified it. It works. The SL will now take on 1/2 ATR. :).
Nice xmess7, thank you for your effort...we glad someone is here to help :)
zhengzuodong
Trader
Posts: 59
Joined: Sat Aug 02, 2014 8:38 am

Coin-Flip EA v2.0

Post by zhengzuodong »

xmess7 » Fri Aug 08, 2014 11:30 am wrote:No problem zhengzuodong. Are you interested in the copy with both the HardSL and HardTP? Or do you just want to copy that contains just the use of HardSL. Let me know.

BTW, I tested the ATR and verified it. It works. The SL will now take on 1/2 ATR. :).
Hi, xmess7

I'm interested in both hardsl and hardtp with the ATR.

many thanks
enjoyforex
Trader
Posts: 13
Joined: Wed Aug 06, 2014 1:12 am

Coin-Flip EA v2.0

Post by enjoyforex »

zhengzuodong » Fri Aug 08, 2014 5:56 am wrote:
xmess7 » Fri Aug 08, 2014 11:30 am wrote:No problem zhengzuodong. Are you interested in the copy with both the HardSL and HardTP? Or do you just want to copy that contains just the use of HardSL. Let me know.

BTW, I tested the ATR and verified it. It works. The SL will now take on 1/2 ATR. :).
Hi, xmess7

I'm interested in both hardsl and hardtp with the ATR.

many thanks
Can you send to me too, jess? i love to try, thanks :xm:

chaoffice at gmail dot com
Post Reply

Return to “Automated trading systems”