|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
|
|
LinkBack (2) | Thread Tools |
|
|
||||
|
||||
|
Quote:
Martingale in its raw form is dangerous. GK
__________________
Forex Factoid Home of the HedgeHog EA |
|
|
||||
|
||||
|
Quote:
Thanks Code:
/*
Each "Trading Time" zone 1 through 4 has a Start and an End.
To trade all day , set "day"...Start1=0 and "day"...End4=24. This is needed for each trading day.
To skip a full day, set "day"...Start1=0 and "day"...End4=0.
Note: EA is coded to use your Local PC Time.
Here is a Monday example.
MonTradeHourStart1 = 0; - (Trading Time zone 1 start)
MonTradeHourEnd1 = 8; - (Trading Time zone 1 end)
MonTradeHourStart2 = 10;
MonTradeHourEnd2 = 16;
MonTradeHourStart3 = 18;
MonTradeHourEnd3 = 20;
MonTradeHourStart4 = 22;
MonTradeHourEnd4 = 24;
In above schedule, EA trades from 00:00 (midnight) to 08:00, then from 10:00 to 16:00, then from 18:00 to 20:00, then from 22:00 to 24:00.
Non-Trading Time is from 08:00 to 10:00, then from 16:00 to 18:00, then from 20:00 to 22:00.
*/
extern int SunTradeHourStart1 = 0; // 4 trading zones per day. To bypass a day, all zeros (=0)for that day.
extern int SunTradeHourEnd1 = 0;
extern int SunTradeHourStart2 = 0;
extern int SunTradeHourEnd2 = 0;
extern int SunTradeHourStart3 = 0;
extern int SunTradeHourEnd3 = 0;
extern int SunTradeHourStart4 = 0;
extern int SunTradeHourEnd4 = 24;
extern int MonTradeHourStart1 = 0;
extern int MonTradeHourEnd1 = 0;
extern int MonTradeHourStart2 = 0;
extern int MonTradeHourEnd2 = 0;
extern int MonTradeHourStart3 = 0;
extern int MonTradeHourEnd3 = 0;
extern int MonTradeHourStart4 = 0;
extern int MonTradeHourEnd4 = 24;
extern int TueTradeHourStart1 = 0;
extern int TueTradeHourEnd1 = 0;
extern int TueTradeHourStart2 = 0;
extern int TueTradeHourEnd2 = 0;
extern int TueTradeHourStart3 = 0;
extern int TueTradeHourEnd3 = 0;
extern int TueTradeHourStart4 = 0;
extern int TueTradeHourEnd4 = 24;
extern int WedTradeHourStart1 = 0;
extern int WedTradeHourEnd1 = 0;
extern int WedTradeHourStart2 = 0;
extern int WedTradeHourEnd2 = 0;
extern int WedTradeHourStart3 = 0;
extern int WedTradeHourEnd3 = 0;
extern int WedTradeHourStart4 = 0;
extern int WedTradeHourEnd4 = 24;
extern int ThurTradeHourStart1 = 0;
extern int ThurTradeHourEnd1 = 0;
extern int ThurTradeHourStart2 = 0;
extern int ThurTradeHourEnd2 = 0;
extern int ThurTradeHourStart3 = 0;
extern int ThurTradeHourEnd3 = 0;
extern int ThurTradeHourStart4 = 0;
extern int ThurTradeHourEnd4 = 24;
extern int FriTradeHourStart1 = 0;
extern int FriTradeHourEnd1 = 0;
extern int FriTradeHourStart2 = 0;
extern int FriTradeHourEnd2 = 0;
extern int FriTradeHourStart3 = 0;
extern int FriTradeHourEnd3 = 0;
extern int FriTradeHourStart4 = 0;
extern int FriTradeHourEnd4 = 24;
//----------------------- ENTER POSITION BASED ON OPEN
int EnterPositionBasedOnOpen()
{
int ret;
double myMA =iMA(NULL,MA_timeframe,MA_length,0,MODE_SMA,PRICE_OPEN,0);
double RVI=iRVI(NULL,0,10,MODE_MAIN,0)-iRVI(NULL,0,10,MODE_MAIN,1); // included by Renato
RVI0_RVI1=RVI;
// Print(" Top, Bid ",myMA*(1+Percent/100)," ",Bid);
// if((myMA*(1+Percent/100))<Bid) Print(" Top, Bid ",myMA*(1+Percent/100)," ",Bid);
CloseTheseTrades();
if(UseEquityProtection) EquityProtection();
if(MyOrdersTotal()<MaxOpenOrders && AccountEquity()/(AccountMargin()+0.0001)>(MinMarginLevel/100))
{
int h=TimeHour(TimeLocal());
int trade=0;
trade=0;
if(UseTradeScheduler==true)
{
if( (DayOfWeek()==0 && ((h >= SunTradeHourStart1) && (h <= (SunTradeHourEnd1-1))) || ((h >= SunTradeHourStart2) && (h <= (SunTradeHourEnd2-1))) || ((h >= SunTradeHourStart3) && (h <=(SunTradeHourEnd3-1))) || ((h >= SunTradeHourStart4) && (h <= (SunTradeHourEnd4-1)))) ||
(DayOfWeek()==1 && ((h >= MonTradeHourStart1) && (h <= (MonTradeHourEnd1-1))) || ((h >= MonTradeHourStart2) && (h <= (MonTradeHourEnd2-1))) || ((h >= MonTradeHourStart3) && (h <=(MonTradeHourEnd3-1))) || ((h >= MonTradeHourStart4) && (h <= (MonTradeHourEnd4-1)))) ||
(DayOfWeek()==2 && ((h >= TueTradeHourStart1) && (h <= (TueTradeHourEnd1-1))) || ((h >= TueTradeHourStart2) && (h <= (TueTradeHourEnd2-1))) || ((h >= TueTradeHourStart3) && (h <=(TueTradeHourEnd3-1))) || ((h >= TueTradeHourStart4) && (h <= (TueTradeHourEnd4-1)))) ||
(DayOfWeek()==3 && ((h >= WedTradeHourStart1) && (h <= (WedTradeHourEnd1-1))) || ((h >= WedTradeHourStart2) && (h <= (WedTradeHourEnd2-1))) || ((h >= WedTradeHourStart3) && (h <=(WedTradeHourEnd3-1))) || ((h >= WedTradeHourStart4) && (h <= (WedTradeHourEnd4-1)))) ||
(DayOfWeek()==4 && ((h >= ThurTradeHourStart1) && (h <= (ThurTradeHourEnd1-1))) || ((h >= ThurTradeHourStart2) && (h <= (ThurTradeHourEnd2-1))) || ((h >= ThurTradeHourStart3) && (h <=(ThurTradeHourEnd3-1))) || ((h >= ThurTradeHourStart4) && (h <= (ThurTradeHourEnd4-1)))) ||
(DayOfWeek()==5 && ((h >= FriTradeHourStart1) && (h <= (FriTradeHourEnd1-1))) || ((h >= FriTradeHourStart2) && (h <= (FriTradeHourEnd2-1))) || ((h >= FriTradeHourStart3) && (h <=(FriTradeHourEnd3-1))) || ((h >= FriTradeHourStart4) && (h <= (FriTradeHourEnd4-1)))))
{
trade=1;
}
}
if(UseTradeScheduler==false) trade=1;
if(trade==0)text="Non-Trading Time";
|
|
|
||||
|
||||
|
I have been using the EA for forward testing for months now. It can be found at my website here and the research in the hedgehog area.
Hope that helps, GK
__________________
Forex Factoid Home of the HedgeHog EA |
|
|
||||
|
||||
|
Quote:
|
|
|
|||
|
|||
|
Read this until My Eyes POPPED!
Wow, lot of reading, but I have a question that goes back to the begining...
You open a "Hedge"..buy and sell order at the same time...00:00 gmt. Set your TP for 14. What do you do with the order that is now negative? Do you open another Hedge at the TP level that was profitable? I am lost on this.... |
|
|
||||
|
||||
|
Quote:
What the hedgehog EA was supposed to do was capitalize on the normal oscillation of the market during non-peak times, so usually both the buy and sell trades TP during certain times. Once they TP they aren't replaced by any other trades until the next trading day (unless you are using 3rd trade and/or bonus trade). Hope this helps, GK
__________________
Forex Factoid Home of the HedgeHog EA |
|
|
|||
|
|||
|
Anyone still using this, and which version is working for you...
Ver 1.1 or 1.3? Quote:
|
|
|
||||
|
||||
|
This thread is one of many hedge EAs style. You could use the forum google search to find more and maybe the one that fits with your needs.
__________________
|
| Thread Tools | |
|
|
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/martingale-average-cost-hedging/1826-hedgehog-system-ea.html
|
|||
| Posted By | For | Type | Date |
| OANDA FXMessage: Virtual no brainer trades...know any? | This thread | Refback | 10-05-2007 07:19 AM |
| Forex trading strategies - Page 9 - Talkgold HYIP, Investment & Money Forum | This thread | Refback | 07-09-2007 11:47 AM |