|
|
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
|
 |
|
|

03-05-2010, 12:20 AM
|
 |
Member
|
|
Join Date: Jul 2007
Location: www.serulink.com
Posts: 49
|
|
use moving average
rule :
buy if price < MA
sell if price > MA
MA periode ... 12 or 16
 
|

03-09-2010, 01:42 PM
|
|
Junior Member
|
|
Join Date: Jan 2006
Posts: 2
|
|
SL management code help
Hi guys,
I have written a piece of code to manage my EA open orders but part of it is not executing (when in loss part). Can someone help?
Here is the code (sorry, it's not nice to read it here but I don't know other way to post it):
//stop loss management
for(i=0;i<Total;i++)
{
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL && // check for opened position
OrderSymbol()==Symbol()) // check for symbol
{
if (OrderLots() == Lots) //Prevent closing multiple times
{
if(OrderType()==OP_BUY) // long position is opened
{
// Move Stop
if (Bid - OrderOpenPrice () >= TakeProfitPartial * Point)
//if(true)
{
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOp enPrice() + 30 * Point,OrderTakeProfit()*Point,0,Purple);//
OrderClose (OrderTicket(), LotsPartial, Bid, 30 /*Slippage*/, Yellow);
////// to close part if in loss and move take profit to b/e --NOT WORKING
if(Bid - OrderOpenPrice () <= - (TakeProfitPartial * Point))
{
OrderModify(OrderTicket(),OrderOpenPrice(),StopLos sLevel,OrderOpenPrice() +30*Point,0,Purple);//
OrderClose (OrderTicket(), LotsPartial, Bid, 30 /*Slippage*/, Yellow);
return(0);
}
}
}
else // go to short position
{
// Move Stop
if (OrderOpenPrice() - Ask >= TakeProfitPartial * Point)
//if(true)
{
OrderModify(OrderTicket(),OrderOpenPrice(),OrderOp enPrice() - 30 * Point,OrderTakeProfit()*Point,0,Purple);/////
OrderClose (OrderTicket(), LotsPartial, Ask, 30 /*Slippage*/, Yellow);
////// to close part if in loss and move take profit to b/e --NOT WORKING
if(OrderOpenPrice() - Ask <= - (TakeProfitPartial * Point))
{
OrderModify(OrderTicket(),OrderOpenPrice(),StopLos sLevel,OrderOpenPrice()-30 *Point,0,Purple);/////
OrderClose (OrderTicket(), LotsPartial, Ask, 30 /*Slippage*/, Yellow);
return(0);
}
}
}
}
}
}
|

03-09-2010, 10:07 PM
|
|
Junior Member
|
|
Join Date: Jan 2006
Posts: 2
|
|
|
SL management code help
It's ok. I fixed it.
Cheers! 
|

03-12-2010, 02:53 PM
|
|
Junior Member
|
|
Join Date: Aug 2009
Posts: 3
|
|
|
Help! How to sort a two dimension array
I am using a two dimension array, say, ZigZag[2][100]. and I want to sort by the first dimension. I use the following function:
ArraySort(ZigZag,WHOLE_ARRAY,0,MODE_DESCEND);
but it seem neither sort by first dimention, nor by second dimension. is there anybody here can help me?
Thanks a lot
|

03-14-2010, 08:35 AM
|
|
Junior Member
|
|
Join Date: Mar 2009
Posts: 2
|
|
|
EA draws MA
How can I draw MA line from my EA?
Thank you in advance
Masheco
|

03-15-2010, 12:03 AM
|
|
Junior Member
|
|
Join Date: Jul 2009
Posts: 4
|
|
If you want to draw a moving average line with your EA, you need to obtain the moving average value from the indicator function, then paint it onto the chart using the trend line option with the ObjectCreate() function.
Here is an example to draw the moving average trend line.
This code is executed at the close of each bar.
static double MA;
static double previousMA;
previousMA = MA;
MA=iMA(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,0);
int time2=Time[0];
ObjectDelete("Tr1"+time2);
ObjectCreate("Tr1"+time2, OBJ_TREND,0,Time[0],MA,
Time[1],previousMA);
ObjectSet("Tr1"+time2, OBJPROP_COLOR,SteelBlue);
ObjectSet("Tr1"+time2, OBJPROP_RAY,false);
ObjectSet("Tr1"+time2, OBJPROP_STYLE,STYLE_SOLID);
coderMike
mql4coder@gmail.com
~providing quality EA programming services~
|

03-15-2010, 05:34 PM
|
|
Junior Member
|
|
Join Date: Mar 2010
Posts: 2
|
|
|
No sound by close Order
Hello !
How can i adjust in metatrader, that he play a sound if a order was taken from the market (because SL or TP or whatever)
I can not found the settings.
Also give it a possibility to loads indicatoren automatic if i open a Chart-Window
All time i close a Chart, and reopen, all indicater and settings(Candlesticks,...) are lost, and i must import again
Thanks for Help
Wolfgang
|

03-15-2010, 07:15 PM
|
 |
Senior Member
|
|
Join Date: Oct 2005
Posts: 1,000
|
|
templates
Hello,
1- There's no sounds for SL/TP events in MetaTrader.
2- You can save all the indicators and the objects of a chart to a template then reload it when you need:
Right click the chart you want to save it as a template.
Choose Templates -> Save Template ..
Give it a name and save it.
To Load the template you saved:
Right click the chart you want to load the template on.
Choose Templates -> Load Template ..
Choose the template.
Quote:
Originally Posted by mausgambler
Hello !
How can i adjust in metatrader, that he play a sound if a order was taken from the market (because SL or TP or whatever)
I can not found the settings.
Also give it a possibility to loads indicatoren automatic if i open a Chart-Window
All time i close a Chart, and reopen, all indicater and settings(Candlesticks,...) are lost, and i must import again
Thanks for Help
Wolfgang
|
|

03-17-2010, 01:09 AM
|
|
Junior Member
|
|
Join Date: Feb 2010
Posts: 1
|
|
|
Reversing Trades MQL
Hey,
I'm wondering if there is any simple way to reverse the trades an EA makes. I know a decent amount of MQL, but I'm not sure if there's an easier way to simply turn all buys into sells and sells into buys, reversing the logic of the trades other than editing every piece of logic. Is there any easier way of doing this?
Thanks
|

03-17-2010, 02:46 AM
|
|
Senior Member
|
|
Join Date: Feb 2006
Posts: 108
|
|
Quote:
Originally Posted by Forex2k11
Hey,
I'm wondering if there is any simple way to reverse the trades an EA makes. I know a decent amount of MQL, but I'm not sure if there's an easier way to simply turn all buys into sells and sells into buys, reversing the logic of the trades other than editing every piece of logic. Is there any easier way of doing this?
Thanks
|
Try this one:
Forex Tester Software - Professional Forex Training. Teach yourself forex trading.
It copy trades from one MT4 to another and there is a setting that reverse trades. I never use it, so I don´t know if work fine, but it can be a option.
|
|
Tags
|
automated close order, close, eas, forex, istochastic, learn mql4, learn mql4 video, learning mql4, mini std lotsize risk, mql4 ima, mql4 learning, mql4 video, OrderCloseBy, profit, re-initialise indicator, reach, secure profit function, stoch, T101_v1.11_orest_IBFXm.mq4  |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 07:49 PM.
|