| 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 (2) | Thread Tools | Display Modes |
|
|||
|
Help with hedging
Hi everyone!
I have used the Expert Advisor Builder at sufx.com to create an EA. It has two limitations that I am trying to get rid of: 1. only opens 1 trade at a time. I can get it to have two trades open at once, but I can't get it to open a buy order and a sell order simultaneously. 2. seems to take sell orders as a preference over buy orders. This wouldn't really be an issue if problem number 1 was solved. Here is the peice of code that seems to be holding me up: Code:
//Check position
bool IsTrade = False;
for (int i = 0; i < Total; i ++) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if (OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {
IsTrade = True;
if (OrderType() == OP_BUY) {
//Close
Cheers for the help, Benjimang |
|
||||
|
Quote:
Dave |
|
|||
|
trading stats
use this code:
// ************************************************** ************************* int stats() { int i, vOrders; // current CP profit vOrders = OrdersTotal(); Profit = 0; PipsProfit = 0; for(i=vOrders-1;i>=0;i--) { if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) { if(OrderSymbol() == Symbol()) { Profit += OrderProfit(); if (OrderType() == OP_BUY) PipsProfit += ((Bid - OrderOpenPrice())/Point); else if (OrderType() == OP_SELL) PipsProfit += ((OrderOpenPrice() - Ask)/Point); } } } // potential risk // max positions } Profit & PipsProfit will need to be declared outside the program, then display then on the screen with your favorite method. Comments if nothing else. Mark |
|
|||
|
Codersguru please help me!
Hello. Perhaps you can help me.
I try to code EA with Ichimoku a Kinko Hyo. It is to set a Buy order, if the Tenkan - sen is over the Kijun - sen. If Tenkan<Kijun then Sell order. And whole at 20.00 o'clock. Please help me. Thank you. fxbeginner |
![]() |
| Bookmarks |
| Tags |
| histogram, forex, ZUP_v1.mq4 |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
|
||||
| Posted By | For | Type | Date | |
| OzFx System:) - Page 639 | This thread | Refback | 06-21-2008 10:53 PM | |
| Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart | This thread | Refback | 12-08-2007 12:46 PM | |