| New signals service! | |
|
|||||||
| 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 | Thread Tools | Display Modes |
|
|||
|
I didn't tested but something like this may be what you need.
Quote:
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM NEW: video presentation of the Probability Meter ... 24hrs action on the website |
|
||||
![]() thanks mr.ferrufx, i will try it... ![]() add; bool ProfitAchieve = true; int Profit_Achieve = 40; int MagicNumber = 123456; int start() { if(ProfitAchieve && Profit() >= Profit_Achieve) CloseOrder(); } int Profit() { double pips=0; int trade; int trades=OrdersTotal(); for(trade=0;trade<trades;trade++) { OrderSelect(trade,SELECT_BY_POS,MODE_TRADES); if(OrderSymbol()==Symbol() && OrderMagicNumber() == MagicNumber) { if(OrderType() == OP_BUY) pips+= (Bid-OrderOpenPrice())/Point; if(OrderType() == OP_SELL) pips+= (OrderOpenPrice()-Ask)/Point; } } //---- for return(pips); } void CloseOrder() { int trades = OrdersTotal(); bool order; for(int trade=0; trade < trades; trade++) { OrderSelect(trade,SELECT_BY_POS,MODE_TRADES); if(OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue; if(OrderType() == OP_BUY) order = OrderClose(OrderTicket(),OrderLots(),Bid,2,Blue); else if(OrderType() == OP_SELL) order = OrderClose(OrderTicket(),OrderLots(),Ask,2,Pink); } //---- for if(!order) CloseOrder(); } Last edited by MANSTIR; 06-10-2008 at 09:19 AM. |
|
|||
|
chart shift coords
Hi,
How does one dynamically find out the coords for the chart shift area? I'm wanting to put labels in there and have them repaint when charts are resized. Currently i only know how to put in the physical coords. Cheers |
|
|||
|
I want to shorter the price
Hi Guys,
finally I've configured my email account on MT4, and I've done an indicator that says me the order opened. But I have still a problem....when I receive the price at which I bought or sold I receive this long value: Price: 1.96830000 Is there a way to shorter it to 1.9683?I've used in the code the BID price. Thanks. Regards, Mauro
__________________
I'm studing to become an MQL Programmer! ![]() The best strategy to use ForexKiller. Try it: http://forex-killerallday.blogspot.com/ |
|
||||
|
string YourNewPrice = DoubleToStr(Bid,Digits);
Quote:
__________________
..updated 4.Oct.08.. IN10TION newsReader v09.84 Lite - the best news reader on your chart
|
|
|||
|
Hi my friend, thanks for your reply.
I put it after: int start() { Is it correct? However I have a problem because at the string Code:
"StopLoss: " + (YourNewPrice - SL*Point) + "pips \n\n" '-' - both operands are to be numeric Thanks for your help!
__________________
I'm studing to become an MQL Programmer! ![]() The best strategy to use ForexKiller. Try it: http://forex-killerallday.blogspot.com/ |
|
||||
|
for the calculation you use Bid again.
a "double" has always those trailing zero's ...DoubleToStr(Bid - (SL*Point),Digits)... Quote:
__________________
..updated 4.Oct.08.. IN10TION newsReader v09.84 Lite - the best news reader on your chart
|
|
|||
|
Quote:
Thanks a lot, Now it works perfect!!! ![]() Regards
__________________
I'm studing to become an MQL Programmer! ![]() The best strategy to use ForexKiller. Try it: http://forex-killerallday.blogspot.com/ |
![]() |
| Bookmarks |
| Tags |
| close, eas, profit, reach |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Learning Cycles For New Traders | Dan7974 | General Discussion | 350 | 01-18-2008 06:04 PM |
| Learning to code for autotrading | GoatT | Metatrader Programming | 8 | 01-10-2007 08:55 PM |
| Self learning expert | mrtools | Expert Advisors - Metatrader 4 | 32 | 10-22-2006 05:29 PM |