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

 

good day to all!

advise if there is such a bicycle or possibility:

there are two accounts and one advisor. a trade on one account is duplicated on the other or vice versa, does not open.

thank you.

 
sergeev:
Comment("blah blah blah")

This "blah blah blah blah" - how do you get it?

Print(), Alert() for output is not the issue.

When you install the COUNTER in the terminal, instead of entering the parameters into it

you simply load existing presets that are in the presets directory

and have a *.set extension (e.g. file - proba.set)

How do you get this name? (proba.set in this case)

 

Good afternoon everyone,

Gentlemen, maybe someone has a simple EA based on RSI. The idea is as follows: when there is a 50% crossing, an order is opened in the direction of the crossing. Only 3 parameters are needed: 50% crossing, stoploss size, take profit size. That is all.

I am grateful in advance for any information.

 
sergeev:


linkage formula: Lot=Money/(Staples*Tick)

Money - earned/lost
Stopplus - in broker points
Tick - MarketInfo( MODE_TICKVALUE)

From here, twist as you wish:

Stopplus=Money/(Lot*Tick)

Money=Lot*Stopplus*Tick

Thank you very much! I don't understand why there's a stop loss
 
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);
}
}
}

}

why in this code it doesn't trawl bai??? only sells???

 
Aleksandr_8:

This "blah blah blah blah" - how do you get it?

Print(), Alert() for output is not the issue.

When you install the COUNTER in the terminal, instead of entering the parameters into the

you simply load the pre-existing presets, which are in the presets directory

and have an extension *.set (for example file - proba.set)

How do you get this name? (proba.set in this case)


extern int StopLoss=50;

extern double Lot=0.1

in the start() function of the EA:

Comment("\n","StopLoss = ",StopLoss,"\n","Lot = ",Lot);

 
rasder:

Good day to all!

advise if there is such a bicycle or possibility:

there are two accounts and one advisor. a trade on one account is duplicated on the other or vice versa, does not open.

thank you.


We need to make a code that will write the orders that appear in the text document, and the EA on another account, upon detecting a new order in the text document, will open exactly the same order. The code should be written not in MQL4, but in a dll in some other programming language, just to save the trouble of writing the path to the file.
 
Aleksandr_8:

How do I get this name? (proba.set in this case)

MQL4 tools will be problematic to get the name of the file - but the problem is quite solvable in other programming languages.
 

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.

 
drknn:
MQL4 tools will be problematic to get the name of the file - but the task can be solved in other programming languages.
Why can't it be generated by WindowExpertName()+".set"?
Reason: