You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Cool thanks guys, both of the suggestions are probably better than what I was working on.
Somebody please help me....
Hi...
I hope somebody here can help me how to code this.This is martiangle EA and what i want to do is:
1 . When 2nd layer post open,i want target point at 1st layer move to target point 2nd layer.So when target point hit at 2nd layer ,that 2 post can close at same time.If 3rd layer is open,that 1st and 2nd layer target point can move to 3rd target point price.So we can close at same time.Same happend if 4th layer,5th layer and other layer open.Just need move all Target Point to current layer Target Point or post.
2.Need pips lock.When 1st layer open,and got profit example 15 pip (TP 32),the ea make locking at sl price(example 5 pip)So when price reversel 10 pip that post can close automatically with profit 5 pips.Just for 1st layer post only.2nd layer do not need activated because this martiangle EA.
I m very sorry for my bad english.Hope someone can help me with put a code at this EA. Thank You
martiangle_rsi_.mq4
Regards
Really Need Help Person
Comment help please
I am trying to set up a comment to show on screen but not having much luck
I have managed to get the pip count for a single pair but I can't seem to show the collated total for multiple pairs
Any help would be great
this is an example of that code
//========== FUNCTION getPipValue
double getPipValue(double ord,int dir)
{
double val;
RefreshRates();
if(dir == 1) val=(NormalizeDouble(ord,Digits) -
NormalizeDouble(Ask,Digits));
else val=(NormalizeDouble(Bid,Digits) - NormalizeDouble(ord,Digits));
val = val/Point*co;
return(val);
}
//== end function
int getSpread()
{
int spread=MarketInfo(Symbol(),MODE_SPREAD);
return(spread);
}
//========== FUNCTION getOpenOrders
void getOpenOrders()
{
int nsl, nsd;
string mngMagic, trailon;
int totalorders = OrdersTotal();
for(int j=0; j<totalorders;j++)
{
OrderSelect(j, SELECT_BY_POS, MODE_TRADES);
if((OrderType() == OP_BUY || OrderType() == OP_SELL) &&
OrderSymbol() == Symbol()&&(MagicNumber==0 || MagicNumber ==
OrderMagicNumber()))
{
double val=getPipValue(OrderOpenPrice(),OrderType());
//int val = OrderProfit()/(OrderLots()*10);
}
if(MagicNumber == 0)
mngMagic = "All "+Symbol()+" trades.";
else
mngMagic = "Trades with magic number = "+MagicNumber;
//RefreshRates();
Comment("Balance: ",AccountBalance(),", Account Equity: ",AccountEquity(),", Account Profit: ",AccountProfit(),"Order Open: ",OrderOpenPrice(),
"\nPip Count: ", val,
"\nMy Account Cutoff Limit: ",Open_Loss_To_CloseTrades,
"\nManaging: ", mngMagic);
Cheers
The pips value of a current order may be obtained by the following:
If you want to use "bid" and "ask", you also need to use the ones related to the order symbol, i.e. MarketInfo( OrderSymbol(), MODE_BID ) and MarketInfo( OrderSymbol(), MODE_ASK ).
ralph.ronnquist
Gidday
thanks for the code i have used it but it only counts for the one pair and not the total of all pairs .
I have been experimenting with various scenarios but still not working
i have an ea that opens 3 positions that i run on 5 pairs I can see the pip count for each pair but not the collective.
ralph.ronnquist
Gidday
thanks for the code i have used it but it only counts for the one pair and not the total of all pairs .
I have been experimenting with various scenarios but still not working
i have an ea that opens 3 positions that i run on 5 pairs I can see the pip count for each pair but not the collective.well, if u r familiar with global variables, u can use them to store the pips info on each pair referenced by each symbols. Create another global variable which references the total pips value and call this particular global variable, get it updated as the pips increase, store it. Global variables can be accessed by each ea since it is stored in MT4's memory.
I can help to code it for u if want.
Gidday ShahJB
I have seen global variables in code before but have had zero experience with them so yes i would like to accept your help to code this as its driving me nuts
Gidday ShahJB I have seen global variables in code before but have had zero experience with them so yes i would like to accept your help to code this as its driving me nuts
i just coded the following promptly. Why don't u add this code first. Give it a try n pm me if it fails. I need to catch some sleep.
string val_old_string = "val_old" + Symbol();
int val_old = GlobalVariableGet(val_old_string);
if(val != val_old)
{
int pips_increment_decrement;
int current_total_pips;
string counter = "Pips Counter";
double pips_counter = GlobalVariableGet(counter);
if (val>val_old)
{
pips_increment_decrement = val - val_old;
current_total_pips = pips_increment_decrement + pips_counter;
GlobalVariableSet(counter, current_total_pips);
GlobalVariableSet(val_old_string, val);
}
else
{
pips_increment_decrement = val_old - val;
current_total_pips = pips_counter - pips_increment_decrement;
GlobalVariableSet(counter, current_total_pips);
GlobalVariableSet(val_old_string, val);
}
}
Why isnt' this working???
Hello,
I am a complete newbie to programming. Thanks to the posts and learning resources on this site I built up courage to attempt building few EAs, one of which will use Lguerre as one of the triggers (I used this website to help me out ; Expert Advisor Builder for MetaTrader 4 ). The problem with my EA is that it won't open buy orders when triggers are hit. I have built a couple of EAs using the aforementioned site and they execute orders for long & short positions just fine (The EAs used RSI's). Please take a look at the attached EA, 3-28, and let me know what I'm doing incorrectly.... am I using the wrong format for the levels to be hit before a trade is executed? Does the Laguerre need additional parameters?
I have spent an embarrassing amount of time on this and I'm on the verge of giving up.... any help is GREATLY appreciated!!!!!
I seem to have found the answer... why do I need to multiply the Laguerre in my EA, though?????
I ran into a problem closing positions. Help please
I ran into a problem that I dont know how to solve. My program has a few open orders and closes them all together but sometimes I think that some of the orders are not filled therefore it keeps waiting till they are filled and that locks up my program. What have you guys found to be the best way to close all open orders? Thank you kindly for your help.
here is the code:
int OrdersTotalLong()
{
int order_total = 0;
for (int i = 0; i < OrdersTotal(); i++)
{
OrderSelect(i,SELECT_BY_POS, MODE_TRADES);
if (OrderType() == OP_BUY)
order_total++;
}
return(order_total);
}
int MaxLongOrder()
{
int order = 0;
double lotsbuyed = 0;
for (int i = 0; i < OrdersTotal(); i++)
{
OrderSelect(i,SELECT_BY_POS, MODE_TRADES);
if ((OrderType() == OP_BUY) && (OrderLots() > lotsbuyed))
{
lotsbuyed = OrderLots();
order = i;
}
}
return(order);
}
int CloseLong()
{
while (OrdersTotalLong() > 0) //until there's no Orders open (close all)
{
if (OrderSelect(MaxLongOrder(), SELECT_BY_POS, MODE_TRADES) == false) continue;
OrderClose(OrderTicket(),OrderLots(), Bid, 3, Green);
}
}
return(0);
}