[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 45
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
Thank you very much. I don't understand why there's a stop-loss here.
you asked " can the price go down?"
That's the distance I called "stop-loss". You can rename it however you like.
you asked " can the price go down?"
That's the distance I called "stop-loss". You can rename it however you like.
Thank you very much.
drknn:
in the start() function of the EA:
Comment("\n","StopLoss = ",StopLoss,"\n","Lot = ",Lot);
This is not it.
Doesn't anyone know about this? I added OrderSelect and it doesn't display with this
void TrailingOrders() {
double di, pa, pb, pp, sl, tp, sp;int cnt2;
for(cnt2=OrdersTotal();cnt2>0;cnt2--)
{
pp=MarketInfo(OrderSymbol(), MODE_POINT);
if (OrderType()==OP_BUY) {
pa=MarketInfo(OrderSymbol(), MODE_ASK);
sp=MarketInfo(OrderSymbol(), MODE_ASK)-MarketInfo(OrderSymbol(), MODE_BID);
if (OrderOpenPrice()-pa>(TrailingStop+TrailingStep-1)*pp || OrderStopLoss()==0 || pa-OrderOpenPrice()>(TrailingStop+TrailingStep-1)*pp) {
di=OrderOpenPrice()-pa-TrailingStop*pp;
if (OrderStopLoss()==0) sl=OrderOpenPrice()+(TrailingStop-sp+TrailingStep-1)*pp; else sl=0;
if (OrderStopLoss() >0) sl=OrderStopLoss() -di;
if (pa-OrderOpenPrice()>(TrailingStop+TrailingStep-1)*pp) sl=pa-(TrailingStop+TrailingStep-1)*pp;
if (OrderTakeProfit()>0) tp=OrderTakeProfit()-di; else tp=0;
ModifyOrder(pa+TrailingStop*pp, sl, tp);
}
}
if (OrderType()==OP_SELL) {
pb=MarketInfo(OrderSymbol(), MODE_BID);
if (pb-OrderOpenPrice()>(TrailingStop+TrailingStep-1)*pp || OrderStopLoss()==0 || OrderOpenPrice()-pb>(TrailingStop+TrailingStep-1)*pp) {
di=pb-OrderOpenPrice()-TrailingStop*pp;
if (OrderStopLoss()==0) sl=OrderOpenPrice()-(TrailingStop+TrailingStep-1)*pp; else sl=0;
if (OrderStopLoss() >0) sl=OrderStopLoss() +di;
if (OrderOpenPrice()-pb>(TrailingStop+TrailingStep-1)*pp) sl=pb+(TrailingStop+TrailingStep-1)*pp;
if (OrderTakeProfit()>0) tp=OrderTakeProfit()+di; else tp=0;
ModifyOrder(pb-TrailingStop*pp, sl, tp);
}
}
}
}
And why can't it be generated via WindowExpertName()+".set"?
how is that possible? more details
which line should be inserted in the COUNTER?
Guys, please advise how to code all unique combinations of 5 digits from 1 to 7, given that the position of the digit does not matter, i.e. 12345 = 54321 = 21345 =... But each digit in the combination can occur only 1 time, i.e. - 12345 - ok, and 12341 - does not fit.
Thank you.
stupidly in front of the head with five loops
for (a=1; a<7; a++)
for (b=1; b<7; b++)
for (c=1; c<7; c++)
....
if (a==b || a==c || a==d || a==e || b==c || b==d || ....) continue;
else print;
Another more civilized variant is to use two arrays. That is array A[b[]],
where b[] are indexes of array A.
Why can't it be generated via WindowExpertName()+".set"?
This is how you give (set) the name of the .set file.
But how do you get it to show on the screen which .set it is currently working with?
Let's say you have 10 sets of .sets with different names and you want to see which .set is on now