• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 4:32am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 4:32am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Candle Stick Pattern Auto Trader 12 replies

All auto trader EA/indi 0 replies

SSS EA v1.0 - Auto Trader Bot 620 replies

An Easy System (With the help of ES Trader - Another Simple System) 13 replies

Auto trader for Currenex? 2 replies

  • Trading Systems
  • /
  • Reply to Thread
  • Subscribe
  • 2
Attachments: Auto Hedge Commodity Trader System
Exit Attachments
Tags: Auto Hedge Commodity Trader System
Cancel

Auto Hedge Commodity Trader System

  • Last Post
  •  
  • Page 1 2
  • Page 1 2
  •  
  • Post #1
  • Quote
  • First Post: Jan 1, 2015 10:55am Jan 1, 2015 10:55am
  •  Scoobidoobi
  • Joined Jul 2012 | Status: Price Action Trader,Systems Coder | 615 Posts

Happy New Year 2015 one and all!



Auto Hedge Commodity Trader System


Auto Hedge Commodity Trader System is a concept to stay hedged in commodity pairs which move alike 80% or more in same direction coupled with leveraging the volatility in UK-US session passage to collect some profits trading them.

Some of the commodity pairs which move in same direction most of the time could be :

i) USOIL(WTI Crude) vs UKOIL(Brent)

ii) XAU USD (GOLD USD) vs XAU EUR (GOLD EUR)

iii) XAU USD (GOLD USD) vs XAG USD (Silver USD)


Note : You guys can suggest any better pairs too , in non commodity world correlation ratio between USD JPY & Nikkei 225 Stock index is whopping 0.86 suggesting tighter correlation.


Entry Condition :

Order Open timings : Start of UK Session to End of US Session (approx)

Lets take OIL which is pretty hot topic at the moment with financial oil wars going around:

System takes the following orders completely hedged:

i) UK OIL BUY/US OIL SELL ==> Set 1
ii) US OIL BUY/UK OIL SELL ===> Set 2

Exit Condition :

Order Close timings : No restrictions in timings when ever Set 1 (or) Set 2 comes to 5pip profit

Attached : Auto Hedge Trader EA for traders ..
Attached File(s)
File Type: mq4 Auto_Hedge_Trader_V1.mq4   7 KB | 1,910 downloads


Currently it does good job with this mechanism, that said looking forward for good suggestions/improvements to take it forward to channelize into next level.

Cheers,
Scoobi
Scoobi doobi doo
  • Post #2
  • Quote
  • Jan 1, 2015 3:28pm Jan 1, 2015 3:28pm
  •  Kasia
  • | Commercial Member | Joined Mar 2012 | 105 Posts
For several months I test on oil trade (WTI and Brent). This strategy is fully automatic. http://www.myfxbook.com/members/Trej...vs-wti/1107223
Since the beginning of this year I will test manually too, according to another idea. If the results will satisfactory then I will present it.
 
 
  • Post #3
  • Quote
  • Jan 1, 2015 4:54pm Jan 1, 2015 4:54pm
  •  dilkasraj
  • | Joined Feb 2012 | Status: Member | 57 Posts
Hi there..

Could you please explain how we overcome the spreads of broker on both sized hedge position ??

You said -
Start of UK Session to End of US Session (approx)....IS it posible to achieve those 5 Pips during this tenure on regular basis ??
 
 
  • Post #4
  • Quote
  • Jan 1, 2015 8:51pm Jan 1, 2015 8:51pm
  •  Scoobidoobi
  • Joined Jul 2012 | Status: Price Action Trader,Systems Coder | 615 Posts
5pips target is not just in uk to us session, its through out other sessions too.

open of orders is allowed in uk to us session, close can occur if TP hits in any session.

lets say u had one set of trades taken yesterday us session and then the target of 5pips reaches during asian session it books the same and adds to equity however fresh trading will start again only at uk open not before. hope u understand.

Try testing on demo on your broker , first make sure both brent and wti crude open/close for trading at the same time. good luck!
Scoobi doobi doo
 
 
  • Post #5
  • Quote
  • Jan 1, 2015 8:52pm Jan 1, 2015 8:52pm
  •  Scoobidoobi
  • Joined Jul 2012 | Status: Price Action Trader,Systems Coder | 615 Posts
Quoting Kasia
Disliked
For several months I test on oil trade (WTI and Brent). This strategy is fully automatic. http://www.myfxbook.com/members/Trej...vs-wti/1107223 Since the beginning of this year I will test manually too, according to another idea. If the results will satisfactory then I will present it.
Ignored

Good Kasia ,interesting!
Scoobi doobi doo
 
 
  • Post #6
  • Quote
  • Jan 1, 2015 10:27pm Jan 1, 2015 10:27pm
  •  lghr
  • Joined Feb 2013 | Status: Member | 668 Posts
the Ask and Bid should be so:

MarketInfo(Symbolx, MODE_ASK)
MarketInfo(Symbolx, MODE_BID)

and

CountOrdersThisPairSmallSELL(Symbol2) == 0 && CountOrdersThisPairBigBUY(Symbol1) == 0

int CountOrdersThisPairSmallBUY(string pp) {
int l_count_0 = 0;
for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++) {
if(!OrderSelect(l_pos_4, SELECT_BY_POS)) continue;
if(OrderSymbol()!=pp) continue;
if (OrderSymbol() == pp && OrderType() == OP_BUY && OrderMagicNumber() == smallmagic) l_count_0++;
}
return (l_count_0);
}
int CountOrdersThisPairBigSELL(string pp) {
int l_count_0;
for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++) {
if(!OrderSelect(l_pos_4, SELECT_BY_POS)) continue;
if(OrderSymbol()!=pp) continue;
if (OrderSymbol() == pp && OrderType() == OP_SELL && OrderMagicNumber() == bigmagic) l_count_0++;
}
return (l_count_0);
}

and so on.
 
 
  • Post #7
  • Quote
  • Jan 1, 2015 10:40pm Jan 1, 2015 10:40pm
  •  oswin
  • | Joined Oct 2012 | Status: Member | 9 Posts
happy new year!

I like topic about hedge ,can tell me your views about S&P 500 vs EURUSD
 
 
  • Post #8
  • Quote
  • Jan 1, 2015 11:00pm Jan 1, 2015 11:00pm
  •  Scoobidoobi
  • Joined Jul 2012 | Status: Price Action Trader,Systems Coder | 615 Posts
Quoting lghr
Disliked
the Ask and Bid should be so: MarketInfo(Symbolx, MODE_ASK) MarketInfo(Symbolx, MODE_BID) and CountOrdersThisPairSmallSELL(Symbol2) == 0 && CountOrdersThisPairBigBUY(Symbol1) == 0 int CountOrdersThisPairSmallBUY(string pp) { int l_count_0 = 0; for (int l_pos_4 = 0; l_pos_4 < OrdersTotal(); l_pos_4++) { if(!OrderSelect(l_pos_4, SELECT_BY_POS)) continue; if(OrderSymbol()!=pp) continue; if (OrderSymbol() == pp && OrderType() == OP_BUY && OrderMagicNumber() == smallmagic) l_count_0++; } return (l_count_0); } int CountOrdersThisPairBigSELL(string pp)...
Ignored


Cool mate, can u create another version with the above changes along with one more change i.e before a set of trades is closed make sure both USOIL/UKOIL are open.

I have seen cases where at brokers USOIL say gets open at 4GMT and UKOil opens at 6GMT, that could lead to one of the pairs USOIL alone getting closed if its greater >=5pip to avoid the race condition we need a smart trigger to check if both markets are open. Hope you got it.

thanks
scoobi
Scoobi doobi doo
 
 
  • Post #9
  • Quote
  • Jan 1, 2015 11:04pm Jan 1, 2015 11:04pm
  •  Scoobidoobi
  • Joined Jul 2012 | Status: Price Action Trader,Systems Coder | 615 Posts
Quoting oswin
Disliked
happy new year! I like topic about hedge ,can tell me your views about S&P 500 vs EURUSD
Ignored

Attached Image
, nowadays i think it does inverse correlation mate
Scoobi doobi doo
 
 
  • Post #10
  • Quote
  • Jan 2, 2015 12:20am Jan 2, 2015 12:20am
  •  piplover143
  • | Joined Oct 2008 | Status: Member | 119 Posts
Happy New year sir and sorry for asking stupid questions 1) is there any timeframe where i have to put above ea? 2) i want to trade xauusd/xagusd so i have to put that ea on both charts and i have to make modification in ea and put above commodity in symbol1 and symbol2 section??
 
 
  • Post #11
  • Quote
  • Jan 2, 2015 3:58am Jan 2, 2015 3:58am
  •  Scoobidoobi
  • Joined Jul 2012 | Status: Price Action Trader,Systems Coder | 615 Posts
Quoting piplover143
Disliked
Happy New year sir and sorry for asking stupid questions 1) is there any timeframe where i have to put above ea? 2) i want to trade xauusd/xagusd so i have to put that ea on both charts and i have to make modification in ea and put above commodity in symbol1 and symbol2 section??
Ignored

Thats right, time frame is not important anything would be ok.

choose any lots as inputs and targets ,also choose any symbols of your choice for trading it. good luck!
Scoobi doobi doo
 
 
  • Post #12
  • Quote
  • Jan 2, 2015 3:59am Jan 2, 2015 3:59am
  •  oswin
  • | Joined Oct 2012 | Status: Member | 9 Posts
Quoting Scoobidoobi
Disliked
{quote} {image} , nowadays i think it does inverse correlation mate
Ignored
can you explain your hedging profit is based on what kind of view in market and rule?

example:eurusd is on Long trend, S&P 500 was volatility,is good timing for entry? or other way?
 
 
  • Post #13
  • Quote
  • Jan 2, 2015 7:02am Jan 2, 2015 7:02am
  •  Scoobidoobi
  • Joined Jul 2012 | Status: Price Action Trader,Systems Coder | 615 Posts
Quoting oswin
Disliked
{quote} can you explain your hedging profit is based on what kind of view in market and rule? example:eurusd is on Long trend, S&P 500 was volatility,is good timing for entry? or other way?
Ignored

I am not sure on currency pair vs stock index scenario like EUR USD vs S&P500 (or) USD JPY vs Nikkei 225.

I am much more comfortable with Commodities of same nature say OIL (UK OIL Vs US OIL) & Gold ( XAU USD Vs XAU EUR) as they always positive correlate most times and there's profits available when trading them hedged in volatile times.
Scoobi doobi doo
 
 
  • Post #14
  • Quote
  • Jan 2, 2015 7:36am Jan 2, 2015 7:36am
  •  piplover143
  • | Joined Oct 2008 | Status: Member | 119 Posts
sir will you please explain more regarding about input of the ea
1)small dollar 2) big dollar 1) small magic 2) big magic
 
 
  • Post #15
  • Quote
  • Jan 2, 2015 7:40am Jan 2, 2015 7:40am
  •  oswin
  • | Joined Oct 2012 | Status: Member | 9 Posts
Quoting Scoobidoobi
Disliked
{quote} I am not sure on currency pair vs stock index scenario like EUR USD vs S&P500 (or) USD JPY vs Nikkei 225. I am much more comfortable with Commodities of same nature say OIL (UK OIL Vs US OIL) & Gold ( XAU USD Vs XAU EUR) as they always positive correlate most times and there's profits available when trading them hedged in volatile times.
Ignored
thanks your reply,right no one can sure the market,that's why we all going hard work and long journey

sorry about my careless in established without seriously to research and testing your EA
i want to know what kind timing and view will open trade and close on this EA you done ??
 
 
  • Post #16
  • Quote
  • Jan 2, 2015 10:45am Jan 2, 2015 10:45am
  •  Akvisto
  • | Commercial Member | Joined Nov 2014 | 145 Posts
it might be helpful

to check this site for different correlations at currencies

https://www.mataf.net/en/tools/01-01-correlation
 
 
  • Post #17
  • Quote
  • Jan 2, 2015 9:51pm Jan 2, 2015 9:51pm
  •  skoda2008
  • | Joined Mar 2010 | Status: Member | 224 Posts
Just looking at the code, I think the calls to Hour() should be changed to TimeHour(TimeCurrent()) to work as intended. Hour() just returns the hour when the EA was first started, not the current server time.
 
 
  • Post #18
  • Quote
  • Jan 3, 2015 2:30am Jan 3, 2015 2:30am
  •  Scoobidoobi
  • Joined Jul 2012 | Status: Price Action Trader,Systems Coder | 615 Posts
Quoting skoda2008
Disliked
Just looking at the code, I think the calls to Hour() should be changed to TimeHour(TimeCurrent()) to work as intended. Hour() just returns the hour when the EA was first started, not the current server time.
Ignored

Hour() >=12 and Hour() < 22 is for trading During UK-US Session as per MT4 Time of the broker you trade..
Scoobi doobi doo
 
 
  • Post #19
  • Quote
  • Edited 3:52am Jan 3, 2015 2:35am | Edited 3:52am
  •  Scoobidoobi
  • Joined Jul 2012 | Status: Price Action Trader,Systems Coder | 615 Posts
Folks can someone setup a Currenex Demo a/c 5k at HF Markets which has UK OIL & US OIL both on VPS , with following inputs and add a trade explorer to the thread :

===================
lots=5; // 1 lot per 1k
Symbol1 = "USOIL";
Symbol2 = "UKOIL";
smalldollars=25; // 5USD TP per set 1
bigdollars=25; // 5USD TP per set 2
smallmagic=11; // default leave as is
bigmagic=22; // default leave as is
basketdollars=true; // enable basket dollars
openStartHour=12; // default leave as is
openEndHour=22; // default leave as is

opennewStartHour=12; // default leave as is
opennewEndHour=22; // default leave as is

===================




Will wait for one Volunteer for testing by tomorrow Sunday , if not I will be the MASCOT for setting up trade explorer.



cheers
Scoobi
Scoobi doobi doo
 
 
  • Post #20
  • Quote
  • Jan 3, 2015 9:44am Jan 3, 2015 9:44am
  •  Legion
  • | Joined Sep 2014 | Status: Member | 3 Posts
Quoting Scoobidoobi
Disliked
Folks can someone setup a Currenex Demo a/c 5k at HF Markets which has UK OIL & US OIL both on VPS , with following inputs and add a trade explorer to the thread : =================== lots=5; // 1 lot per 1k Symbol1 = "USOIL"; Symbol2 = "UKOIL"; smalldollars=25; // 5USD TP per set 1 bigdollars=25; // 5USD TP per set 2 smallmagic=11; // default leave as is bigmagic=22; // default leave as is basketdollars=true; // enable basket dollars openStartHour=12; // default leave as is openEndHour=22; // default leave as is opennewStartHour=12; // default...
Ignored

Hi Scooby,
I will put to the test and without changes to EA in my FXCM account (Demo).
Let's see what happens.
But I think it could open positions when prices have a certain distance (pips or $). What do you think?
 
 
  • Trading Systems
  • /
  • Auto Hedge Commodity Trader System
  • Reply to Thread
    • Page 1 2
    • Page 1 2
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023