Forex



Go Back   Forex Trading > Programming > MetaTrader
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1491 (permalink)  
Old 12-09-2008, 12:56 AM
Junior Member
 
Join Date: May 2008
Posts: 2
vinafx is on a distinguished road
Please help me to add matigale code

I have just mde this EA using this site: Expert Advisor Builder for MetaTrader 4 basing on simple rules to trade.

You can try this EA to see the result. Please set SL = 100, TP = 300 , trailing stop = 70 and run it on EUR/USD H4.


Would you please kindly help me put martigale to trade this system:

Use an amount so that 100 pips = 2% of account balance
If the trade n-1 is lost, double amount of trade n until closing position with profit.

Thank you very much!
Attached Files
File Type: mq4 simplesystem.mq4 (10.1 KB, 19 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1492 (permalink)  
Old 12-09-2008, 01:05 AM
Junior Member
 
Join Date: May 2008
Posts: 2
vinafx is on a distinguished road
Quote:
Originally Posted by vinafx View Post
I have just mde this EA using this site: Expert Advisor Builder for MetaTrader 4 basing on simple rules to trade.

You can try this EA to see the result. Please set SL = 100, TP = 300 , trailing stop = 70 and run it on EUR/USD H4.


Would you please kindly help me put martigale to trade this system:

Use an amount so that 100 pips = 2% of account balance
If the trade n-1 is lost, double amount of trade n until closing position with profit.

Thank you very much!
It worths to spend a little time, friends! This is the result of trading without martigale code. Initial deposit: 10000; 1 lot per trade. SL = 100; TP = 300; Trailing ST: 70; EUR/USD H4.
Attached Images
File Type: gif TesterGraph.gif (5.7 KB, 74 views)

Last edited by vinafx; 12-09-2008 at 01:09 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1493 (permalink)  
Old 12-10-2008, 04:39 PM
Member
 
Join Date: Aug 2008
Posts: 36
fercan is on a distinguished road
how do you simplify this code?

the difference between a and b <= c then trade = true, else false..

so far this is what i have made if anyone can show me a shorter way to code this..

if ( a >= b)
{
if (a - b <= c ) trade = true;
if (a - b > c) trade = false;
}
if ( a < b)
{
if (b - a <= c ) trade = true;
if (b - a > c) trade = false;
}

Last edited by fercan; 12-10-2008 at 04:41 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1494 (permalink)  
Old 12-10-2008, 06:08 PM
mladen's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,269
mladen is on a distinguished road
try this (I am assuming that c is >= 0)
PHP Code:
trade = (MathAbs(a-b) <= c); 
regards
mladen

Quote:
Originally Posted by fercan View Post
how do you simplify this code?

the difference between a and b <= c then trade = true, else false..

so far this is what i have made if anyone can show me a shorter way to code this..

if ( a >= b)
{
if (a - b <= c ) trade = true;
if (a - b > c) trade = false;
}
if ( a < b)
{
if (b - a <= c ) trade = true;
if (b - a > c) trade = false;
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1495 (permalink)  
Old 12-11-2008, 01:38 AM
Member
 
Join Date: Aug 2008
Posts: 36
fercan is on a distinguished road
Quote:
Originally Posted by mladen View Post
try this (I am assuming that c is >= 0)
PHP Code:
trade = (MathAbs(a-b) <= c); 
regards
mladen
thank you.. i was looking for something like this before.. thanks..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1496 (permalink)  
Old 12-11-2008, 07:45 AM
Junior Member
 
Join Date: Aug 2008
Location: Sacramento
Posts: 10
kevin07 is on a distinguished road
test NonLagZigZag_Signal_v2 alerts

Quote:
Originally Posted by tk748 View Post
Hi kevin07,

Thanks ...Perhaps ... you will have an idea about how to make the signals appear at the proper time...
Regards,

Tom
Hey Tom,
I was able to get back to this ZigZag indi and filter out intermediate alerts. I'm sending this immediately and have not tested it. Please let me know if you find any alert related problems with it.
Thanks
kevin07
Attached Files
File Type: mq4 NonLagZigZag_signal_v2.mq4 (7.8 KB, 20 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1497 (permalink)  
Old 12-11-2008, 02:59 PM
Junior Member
 
Join Date: Feb 2008
Posts: 10
litcons is on a distinguished road
Hello, I have an expert i use that needs to be able to resend a buy or a sell order if there is a problem opening the order up if the the server is disconnected, busy or what have you. This morning it should have opened an order but couldn't because the platform was disconnected. In the code right now it is set to wait 3 seconds then try again, which it did but it only tried 3 times then stopped trying to send the order thru. my ea doesn't scalp but is more a mid term trade so I only get 1-3 trades per week per pair. How can i have it coded so it will wait 10 seconds before it tries again and then it will keep trying to send the order until it gets through, i would like to have the option of adjusting it in the code how many seconds it waits to try again and then also how many times it will keep trying.

I've attached a snippet of code so someone could see what could be changed. Thanks in advance for your help!

Mike

RefreshRates();
int ticket=OrderSend(Symbol(),OP_BUY,ManagedLotSize(), Ask,Slippage,sl,tp,"Expert" + " - " + Period(),MagicNumber,0,Lime);

if(ticket<0)
{
Print("Error opening BUY order : ",GetLastError());

Sleep(3000); //---- wait for 3 seconds
}
else
{
break;
}
}
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES ))
{
Print("BUY order opened : ",OrderOpenPrice());
}
else
{
Print("Error opening BUY order : ",GetLastError());
}
}

void ManageSell()
{
double tp,sl;
if (TakeProfit==0) { tp=0; } else { tp=Bid-TakeProfit*Point; }
if (StopLoss==0) { sl=0; } else { sl=Bid+StopLoss*Point; }

for (int i = 1; i <=5; i++) //---- Loop if requote
{
RefreshRates();
int ticket=OrderSend(Symbol(),OP_SELL,ManagedLotSize() ,Bid,Slippage,sl,tp,"Expert" + " - " + Period(),MagicNumber,0,Red);

if(ticket<0)
{
Print("Error opening SELL order : ",GetLastError());

Sleep(3000); //---- wait for 3 seconds
}
else
{
break;
}
}
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES ))
{
Print("SELL order opened : ",OrderOpenPrice());
}
else
{
Print("Error opening SELL order : ",GetLastError());
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1498 (permalink)  
Old 12-12-2008, 01:20 PM
Senior Member
 
Join Date: Nov 2006
Posts: 308
luxinterior is on a distinguished road
Use the OrderReliable include file.

Lux
Attached Files
File Type: mqh OrderReliable.mqh (25.7 KB, 17 views)
__________________
Build An Expert Advisor. FREE E-course As Seen On TV
ForexArea.com
Users of Gap Trader from 'Forex-Assistant' MUST Read This
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1499 (permalink)  
Old 12-13-2008, 02:07 AM
Junior Member
 
Join Date: Oct 2008
Posts: 24
tk748 is on a distinguished road
Re: test NonLagZigZag_Signal_v2 alerts

Hi kevin07,

I will test the new version of nonlagzigzag alert signal when the market opens Sunday. Thanks again for your work. You and others here who give their time and expertise pro bono are what makes many of us more successful traders. I will let you know my results with the new indi.

Best regards, Tom.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1500 (permalink)  
Old 12-16-2008, 03:55 AM
Member
 
Join Date: Sep 2006
Posts: 50
swagboy is on a distinguished road
...................

Last edited by swagboy; 12-20-2008 at 04:29 PM. Reason: wrong thread
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
#include, candle time, CHinGsMAroonCLK, code, coders guru, conditionally, dll, eli hayun, Eur_harvester.ex4, expert adviser, expert advisor, forex, higher high, how to code, indicator, I_XO_A_H, kehedge, mechanical trading, metatrader command line, mt4, MT4-LevelStop-Reverse, OrderReliable.mqh, programming, rectangle tool, trading, volty channel stop


Currently Active Users Viewing This Thread: 4 (1 members and 3 guests)
luxinterior
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 Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to code this? iscuba11 Metatrader 4 mql 4 - Development course 1 08-03-2007 05:22 PM


All times are GMT. The time now is 04:30 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.