Forex
Google
New signals service!

Go Back   Forex Trading > Trading systems > Martingale/Average Cost and Hedging


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

Reply
 
LinkBack (50) Thread Tools Display Modes
  #651 (permalink)  
Old 12-29-2007, 03:01 AM
Senior Member
 
Join Date: May 2006
Posts: 139
waltini is on a distinguished road
A little help for Tiger Wong

Quote:
Originally Posted by matrixebiz View Post
Ok, so does the "Indicator settings = True" override the TradeLong and TradeShort settings and Visa-Versa?
Tiger Wong, thanks for the fantastic job you are doing and maybe I can help a little.

Matrixebiz, if you have Trade Long = true and Use Sniper = true, the ea will only place trades when the Sniper is above zero. Trades above the first trade will be placed at trend intervals when the Sniper is above zero or green.
Below the first trade the price must be at least "spacing" pips away and the Sniper must be above zero. So if the price trended down strongly by 100 pips and the 1 minute sniper never got above zero, no further trades would be placed. As soon as the sniper pops its head above zero and it is more than "spacing" below the lowest buy it will place the next trade.

If you have TradeLong = true and TradeShort = false it will only ever place Long trades regardless of what any of the indicators are saying.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #652 (permalink)  
Old 12-29-2007, 05:40 AM
Member
 
Join Date: Nov 2006
Posts: 94
tiger_wong is on a distinguished road
your help is really helpfull

@waltini

Thanks for your clear explanation. You got the point!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #653 (permalink)  
Old 12-29-2007, 09:17 AM
Senior Member
 
Join Date: Jul 2007
Posts: 208
duyduy is on a distinguished road
Quote:
Originally Posted by matrixebiz View Post
What settings?
Thanks
here is my setting for GU oNLY
Minimum balance is $1500
Trade Long Only or Short Only
I decide it manually
I use pipmaker v mod4c as a tool to manage TP.
I thinks this version will be great cause have SL

TradeShort=0
TradeLong=1
UseDPO=0
UseSniper=0
LotSize=0.10000000
LotIncrement=0.10000000
Multiplier=0.00000000
ProfitTarget=14
OpenOnTick=1
Spacing=10
TrendSpacing=1000
CounterTrendMultiplier=1.00000000
CloseDelay=0
CeaseTrading=0
PasueTrading=Pause Trading at Timeinterval
StartTime=0
EndTime=0
QuitTrading=Quit Trading at Time
endDayHourMinute=0
RightSideLabel=1
SessionTarget=35
MaximumBuyOrders=5
MaximumSellOrders=5
SLTotalinDollar=350.00000000
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #654 (permalink)  
Old 12-29-2007, 10:17 AM
Member
 
Join Date: Oct 2007
Posts: 84
richest is on a distinguished road
I haven't forward testing the mod 4c yet, but is it true that once the session profit reached the EA stops instead of reaching another session profit target?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #655 (permalink)  
Old 12-29-2007, 12:14 PM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,131
matrixebiz is on a distinguished road
Quote:
Originally Posted by waltini View Post
Tiger Wong, thanks for the fantastic job you are doing and maybe I can help a little.

Matrixebiz, if you have Trade Long = true and Use Sniper = true, the ea will only place trades when the Sniper is above zero. Trades above the first trade will be placed at trend intervals when the Sniper is above zero or green.
Below the first trade the price must be at least "spacing" pips away and the Sniper must be above zero. So if the price trended down strongly by 100 pips and the 1 minute sniper never got above zero, no further trades would be placed. As soon as the sniper pops its head above zero and it is more than "spacing" below the lowest buy it will place the next trade.

If you have TradeLong = true and TradeShort = false it will only ever place Long trades regardless of what any of the indicators are saying.
Ok, thanks for that. Do you recommend using the indicators? or just turn them off and let the EA trade normally? Not really familiar with these indicators.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #656 (permalink)  
Old 12-29-2007, 11:23 PM
freedom131477's Avatar
Junior Member
 
Join Date: Nov 2007
Posts: 21
freedom131477 is on a distinguished road
no it doesent wor and here is what i can download.I try to compile that in metatreder editor but there are some faults and i dont know how to repaire.
However thanks for ansver.At the moment i am play with version 9.1 what i download and for now result is awsom.




//+--------------------------------------------------+ //|PipMaker v5 Neo Last Update 06-27-2007 01:05am | //+--------------------------------------------------+ #include #include #define NL "\n" // Regular variables //extern bool AverageDown = false; extern int AverageDown = 0; extern double LotSize = 0.01; extern double LotIncrement = 1.01; //extern bool Multiplier = true; extern int Multiplier = 0; extern double TargetReducer = 0.75; extern int ProfitTarget = 50; //extern bool OpenOnTick = false; extern int OpenOnTick = 0; extern int Spacing = 2; extern int TrendSpacing = 1; extern double CounterTrendMultiplier = 2; extern double CloseDelay = 91; extern int TrendTimeFrame = PERIOD_M1; extern int TrendPeriods = 1200; extern bool CeaseTrading = false; // Internal settings int Step = 1; int Error = 0; int Order = 0; int Orders = 1; int Slippage = 0; int Reference = 0; string TradeComment = "PipMaker v5 Neo"; datetime BarTime = 0; static bool TradeAllowed = true; double TickPrice = 0; int MaxBuys = 0; int MaxSells = 0; bool Auditing = true; string Filename = "PipMaker.txt"; int init() { if (Symbol() == "AUDCADm" || Symbol() == "AUDCAD") Reference = 801001; if (Symbol() == "AUDJPYm" || Symbol() == "AUDJPY") Reference = 801002; if (Symbol() == "AUDNZDm" || Symbol() == "AUDNZD") Reference = 801003; if (Symbol() == "AUDUSDm" || Symbol() == "AUDUSD") Reference = 801004; if (Symbol() == "CHFJPYm" || Symbol() == "CHFJPY") Reference = 801005; if (Symbol() == "EURAUDm" || Symbol() == "EURAUD") Reference = 801006; if (Symbol() == "EURCADm" || Symbol() == "EURCAD") Reference = 801007; if (Symbol() == "EURCHFm" || Symbol() == "EURCHF") Reference = 801008; if (Symbol() == "EURGBPm" || Symbol() == "EURGBP") Reference = 801009; if (Symbol() == "EURJPYm" || Symbol() == "EURJPY") Reference = 801010; if (Symbol() == "EURUSDm" || Symbol() == "EURUSD") Reference = 801011; if (Symbol() == "GBPCHFm" || Symbol() == "GBPCHF") Reference = 801012; if (Symbol() == "GBPJPYm" || Symbol() == "GBPJPY") Reference = 801013; if (Symbol() == "GBPUSDm" || Symbol() == "GBPUSD") Reference = 801014; if (Symbol() == "NZDJPYm" || Symbol() == "NZDJPY") Reference = 801015; if (Symbol() == "NZDUSDm" || Symbol() == "NZDUSD") Reference = 801016; if (Symbol() == "USDCHFm" || Symbol() == "USDCHF") Reference = 801017; if (Symbol() == "USDJPYm" || Symbol() == "USDJPY") Reference = 801018; if (Symbol() == "USDCADm" || Symbol() == "USDCAD") Reference = 801019; if (Reference == 0) Reference = 801999; } int deinit() { } void CloseBuysInProfit() { double BuyProfit, LastBuyTime; RefreshRates(); for (Order = OrdersTotal() - 1; Order >= 0; Order--) { if (OrderSelect(Order, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol() == Symbol() && OrderMagicNumber() == Reference && OrderType() == OP_BUY) { BuyProfit = OrderProfit() + OrderSwap() + OrderCommission(); if (OrderOpenTime() > LastBuyTime) LastBuyTime = OrderOpenTime(); if ((IsTesting() || TimeCurrent() - LastBuyTime >= CloseDelay) && BuyProfit > 0) OrderClose(OrderTicket(), OrderLots(), Bid, 5, Green); Error = GetLastError(); if (Error != 0) Write("Error closing BUY order " + OrderTicket() + ": " + ErrorDescription(Error) + " (A" + Error + ") Lots:" + OrderLots() + " Bid:" + MarketInfo(OrderSymbol(), MODE_BID)); } } } return; } void CloseSellsInProfit() { double SellProfit, LastSellTime; RefreshRates(); for (Order = OrdersTotal() - 1; Order >= 0; Order--) { if (OrderSelect(Order, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol() == Symbol() && OrderMagicNumber() == Reference && OrderType() == OP_SELL) { SellProfit = OrderProfit() + OrderSwap() + OrderCommission(); if (OrderOpenTime() > LastSellTime) LastSellTime = OrderOpenTime(); if ((IsTesting() || TimeCurrent() - LastSellTime >= CloseDelay) && SellProfit > 0) OrderClose(OrderTicket(), OrderLots(), Ask, 5, Red); Error = GetLastError(); if (Error != 0) Write("Error closing SELL order " + OrderTicket() + ": " + ErrorDescription(Error) + " (B" + Error + ") Lots:" + OrderLots() + " Ask:" + MarketInfo(OrderSymbol(), MODE_ASK)); } } } return; } void PlaceBuyOrder() { double BuyOrders, Lots; double LowestBuy = 1000, HighestBuy; if (BarTime != Time[0]) { BarTime = Time[0]; TickPrice = 0; TradeAllowed = true; } RefreshRates(); for (Order = OrdersTotal() - 1; Order >= 0; Order--) { if (OrderSelect(Order, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol() == Symbol() && OrderMagicNumber() == Reference && OrderType() == OP_BUY) { if (OrderOpenPrice() < LowestBuy) LowestBuy = OrderOpenPrice(); if (OrderOpenPrice() > HighestBuy) HighestBuy = OrderOpenPrice(); BuyOrders++; } } } if (TradeAllowed) { if (Ask >= HighestBuy + (TrendSpacing * Point)) { // if (Multiplier) if (Multiplier == 1) Lots = NormalizeDouble(LotSize * (MathPow(LotIncrement, BuyOrders) / Orders), 2); else Lots = NormalizeDouble(LotSize + ((LotIncrement * BuyOrders) / Orders), 2); } if (Ask <= LowestBuy - (Spacing * Point)) { // if (Multiplier) if (Multiplier == 1) Lots = NormalizeDouble(LotSize * CounterTrendMultiplier * (MathPow(LotIncrement, BuyOrders) / Orders), 2); else Lots = NormalizeDouble((LotSize * CounterTrendMultiplier) + ((LotIncrement * BuyOrders) / Orders), 2); } if (Lots == 0) { // if (Multiplier) if (Multiplier == 1) Lots = NormalizeDouble(LotSize * CounterTrendMultiplier, 2); else Lots = NormalizeDouble(LotSize, 2); } OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0, TradeComment, Reference, Green); Error = GetLastError(); if (Error != 0) Write("Error opening BUY order: " + ErrorDescription(Error) + " (C" + Error + ") Ask:" + Ask + " Slippage:" + Slippage); else { TickPrice = Close[0]; TradeAllowed = false; } } } void PlaceSellOrder() { double SellOrders, Lots; double HighestSell, LowestSell = 1000; if (BarTime != Time[0]) { BarTime = Time[0]; TickPrice = 0; TradeAllowed = true; } RefreshRates(); for (Order = OrdersTotal() - 1; Order >= 0; Order--) { if (OrderSelect(Order, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol() == Symbol() && OrderMagicNumber() == Reference && OrderType() == OP_SELL) { if (OrderOpenPrice() > HighestSell) HighestSell = OrderOpenPrice(); if (OrderOpenPrice() < LowestSell) LowestSell = OrderOpenPrice(); SellOrders++; } } } if (TradeAllowed) { if (Bid <= LowestSell - (TrendSpacing * Point)) { // if (Multiplier) if (Multiplier == 1) Lots = NormalizeDouble(LotSize * (MathPow(LotIncrement, SellOrders) / Orders), 2); else Lots = NormalizeDouble(LotSize + ((LotIncrement * SellOrders) / Orders), 2); } if (Bid >= HighestSell + (Spacing * Point)) { // if (Multiplier) if (Multiplier == 1) Lots = NormalizeDouble(LotSize * CounterTrendMultiplier * (MathPow(LotIncrement, SellOrders) / Orders), 2); else Lots = NormalizeDouble((LotSize * CounterTrendMultiplier) + ((LotIncrement * SellOrders) / Orders), 2); } if (Lots == 0) { // if (Multiplier) if (Multiplier == 1) Lots = NormalizeDouble(LotSize * CounterTrendMultiplier, 2); else Lots = NormalizeDouble(LotSize, 2); } OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, 0, 0, TradeComment, Reference, Red); Error = GetLastError(); if (Error != 0) Write("Error opening SELL order: " + ErrorDescription(Error) + " (D" + Error + ") Bid:" + Bid + " Slippage:" + Slippage); else { TickPrice = Close[0]; TradeAllowed = false; } } } int start() { double MarginPercent; static double LowMarginPercent = 10000000, LowEquity = 10000000; double BuyPipTarget, SellPipTarget; int SellOrders, BuyOrders; double BuyPips, SellPips, BuyLots, SellLots; double LowestBuy = 999, HighestBuy = 0.0001, LowestSell = 999, HighestSell = 0.0001, HighPoint, MidPoint, LowPoint; double Profit = 0, BuyProfit = 0, SellProfit = 0, PosBuyProfit = 0, PosSellProfit = 0; int HighestBuyTicket, LowestBuyTicket, HighestSellTicket, LowestSellTicket; double HighestBuyProfit, LowestBuyProfit, HighestSellProfit, LowestSellProfit; double CurrentTime = (TimeHour(CurTime() + TimeMinute(CurTime()))); double Trend; bool SELLme = false; bool BUYme = false; double Margin = MarketInfo(Symbol(), MODE_MARGINREQUIRED); string Message; for (Order = OrdersTotal() - 1; Order >= 0; Order--) { if (OrderSelect(Order, SELECT_BY_POS, MODE_TRADES)) { if (OrderSymbol() == Symbol() && OrderMagicNumber() == Reference) { Profit = OrderProfit() + OrderSwap() + OrderCommission(); if (OrderType() == OP_BUY) { if (OrderOpenPrice() >= HighestBuy) { HighestBuy = OrderOpenPrice(); HighestBuyTicket = OrderTicket(); HighestBuyProfit = Profit; } if (OrderOpenPrice() <= LowestBuy) { LowestBuy = OrderOpenPrice(); LowestBuyTicket = OrderTicket(); LowestBuyProfit = Profit; } BuyOrders++; if (BuyOrders > MaxBuys) MaxBuys = BuyOrders; BuyLots += OrderLots(); BuyProfit += Profit; if (Profit > 0) PosBuyProfit += Profit; } if (OrderType() == OP_SELL) { if (OrderOpenPrice() <= LowestSell) { LowestSell = OrderOpenPrice(); LowestSellTicket = OrderTicket(); LowestSellProfit = Profit; .etc...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #657 (permalink)  
Old 12-30-2007, 01:34 AM
Senior Member
 
Join Date: May 2006
Posts: 139
waltini is on a distinguished road
That is the question

Quote:
Originally Posted by matrixebiz View Post
Ok, thanks for that. Do you recommend using the indicators? or just turn them off and let the EA trade normally? Not really familiar with these indicators.
Hi Matrixebiz, that is the million dollar question, there is no doubt that the ea has great potential. Essentially it is a more sophisticated 10.3. with the same potential for damage.

Perhaps duyduy can best answer you, he is the forward testing guru. I am still playing with the backtester and experimenting going long and short on correlated currencies.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #658 (permalink)  
Old 12-30-2007, 01:55 AM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,131
matrixebiz is on a distinguished road
Quote:
Originally Posted by waltini View Post
Hi Matrixebiz, that is the million dollar question, there is no doubt that the ea has great potential. Essentially it is a more sophisticated 10.3. with the same potential for damage.

Perhaps duyduy can best answer you, he is the forward testing guru. I am still playing with the backtester and experimenting going long and short on correlated currencies.
Yeah, I knew this was different than 10.3 but when I saw it do straight martingale this week on EUR/JPY I thought I did something wrong. It would be great for the EA to open opposite direction trades when EA is going against you, like Hedging, cover some of the losses or turning into winning ProfitTarget if trend doesn't reverse back in your favor.

also, is there a DPO Indicator that I can attach to a chart to see what it's doing?

Last edited by matrixebiz; 12-30-2007 at 04:25 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #659 (permalink)  
Old 12-30-2007, 10:29 AM
Senior Member
 
Join Date: May 2006
Posts: 139
waltini is on a distinguished road
Time to do some code reading

Quote:
Originally Posted by matrixebiz View Post
Yeah, I knew this was different than 10.3 but when I saw it do straight martingale this week on EUR/JPY I thought I did something wrong. It would be great for the EA to open opposite direction trades when EA is going against you, like Hedging, cover some of the losses or turning into winning ProfitTarget if trend doesn't reverse back in your favor.

also, is there a DPO Indicator that I can attach to a chart to see what it's doing?
Hi Matrixebiz, I believe the general consensus is to either go long or short only. To achieve hedging take the opposite position in another correlated currency or the same currency(different chart). By having trades with the trend closer together and trades against the trend further apart, hopefully any losses taken by trades against the trend will quickly be overcome by the other currency. This strategy was mentioned by someone else and is not my idea.

A quick look at the code looks to me like someone(probably tiger wong) has named the indicator which is a 2 period linear weighted moving average(30 min timeframe), using a weighted close and using the current bar which is being formed. This indicator is one of the set of indicators provided with metatrader, just use a moving average and put in the parameters.

In this case for a long trade the moving average must be above the open price for the day for any long trades to be taken if DPO=true.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #660 (permalink)  
Old 12-30-2007, 05:11 PM
Junior Member
 
Join Date: May 2007
Posts: 5
answerpips is on a distinguished road
forward testing

this ea looks really good from what i'v read so far.
how do u really carryout the forward testing.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
Pipmaker, pipmaker forex, pipmaker ea, adaptive RSI

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/martingale-average-cost-hedging/8126-pipmaker-v1-price-action-based-ea.html
Posted By For Type Date
Bless EA [zmodykifowana] This thread Refback 08-17-2008 04:23 AM
Bless EA [zmodykifowana] This thread Refback 08-06-2008 08:05 PM
Bless EA [zmodykifowana] This thread Refback 08-06-2008 10:53 AM
Bless EA [zmodykifowana] This thread Refback 07-29-2008 12:07 PM
Per tutti: Expert Advisor/Strategia da valutare - Forex Forum This thread Refback 06-26-2008 09:37 AM
FX扑旦氾丞玄伊□玉憤がыъ撢薨撮 Post #1021 Refback 06-24-2008 02:16 PM
FX扑旦氾丞玄伊□玉憤がыъ撢薨撮 Post #1021 Refback 06-14-2008 04:09 PM
丟正玄伊□母□分丑〞﹛ 200805 This thread Refback 06-06-2008 03:17 PM
Per tutti: Expert Advisor/Strategia da valutare - Forex Forum This thread Refback 04-15-2008 12:39 PM
^g!@SXX: PipMaker This thread Refback 03-28-2008 02:42 AM
^g!@SXX: tEA!! This thread Refback 03-26-2008 12:06 AM
^g!@SXX This thread Refback 03-25-2008 11:15 PM
Expert Advisor | Forex MetaTrader Expert Advisors | Over 40 of the Best EA's for MT4 on Squidoo This thread Refback 03-14-2008 04:32 AM
Expert Advisor | Forex MetaTrader Expert Advisors | Over 40 of the Best EA's for MT4 on Squidoo This thread Refback 03-09-2008 07:41 PM
Expert Advisor | Forex MetaTrader Expert Advisors | Over 40 of the Best EA's for MT4 on Squidoo This thread Refback 03-07-2008 02:31 AM
≠MT4∞MetaTrader Part8≠丟正玄伊□母□∞ - MetaTrader引午戶Wiki This thread Refback 02-24-2008 06:14 AM
ゞ堣吨韝リ滮咫韝リ漶式式再ll you need is TREND〞﹋移鎖﹌ This thread Refback 02-23-2008 08:51 PM
Per tutti: Expert Advisor/Strategia da valutare - Forex Forum This thread Refback 02-23-2008 11:01 AM
塈琠堻椈堭堛塈 堻堹堹 !!! - 媯堶 16 - Sarmaye Forums This thread Refback 02-21-2008 12:27 AM
塈琠堻椈堭堛塈 堻堹堹 !!! - 媯堶 16 - Sarmaye Forums This thread Refback 02-13-2008 06:28 AM
TSD及白巧□仿丞尺及伉件弁 | 1坳晚井日杴隙允葆鳳莢汊 This thread Refback 02-09-2008 09:35 PM
塈琠堻椈堭堛塈 堻堹堹 !!! - 媯堶 16 - Sarmaye Forums This thread Refback 02-08-2008 01:34 PM
塈琠堻椈堭堛塈 堻堹堹 !!! - 媯堶 15 - Sarmaye Forums This thread Refback 02-08-2008 01:18 PM
塈琠堻椈堭堛塈 堻堹堹 !!! - 媯堶 16 - Sarmaye Forums This thread Refback