[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 845

 
Top2n:
Maybe someone has a written loca code, please send it to me. I'd be grateful to you!
I have already answered you in person, that it is the same opening pose, but in the opposite direction. And the volume of the pose see for yourself, based on your logic.
 
I did it with the pending, but there is a bug, the more often it opens in this place, the further away from the order it becomes. it needs to be without a cover and right on the spot, but I cannot write the conditions under what circumstances it will open!
 
Top2n:
I did it with a pending one, but there's a problem: the more often it opens in this place, the further away from the order it becomes. I need it to be without a cover but right on the spot, but I cannot write the conditions under what circumstances it should open!

If you yourself can't decide on the opening conditions, then how can I help you?

You have to try somehow to formalise what you want to do.

 
The opposite order should open at a certain point, and if it is closed, it should open at the same point again, if the price goes down to it, of course.
 
Top2n:
The opposite order should open at a certain point and then, if it has closed, it will open at this point again, if the price has moved down to it. i think so

Honestly... It's more like some kind of TOR from a notorious customer, of which there are many, rather than the programmer's logic :)

1. Do you need a pending order or open an opposite position if the current position reaches a certain amount of points of loss?

2. If it is an opposite order, and the price touched it, then it will be transformed into a market order, hence

2.1. if a market position has closed (with a loss? with a profit?), will the same order be placed again at the same price? (its type will depend on the current price)

2.2 If a pending order triggers, should I set it again?

2.3

2.4.

.... There are a million more questions to ask. Let us not pincer-peck for information about what you are after, huh?

Write down the logic of what you want to do. That's the first thing. You can write it on a piece of paper and a pencil...

And then you can decide how to put it all into code.

 

I am interested in working with volumes. there are files in .csv format . i looked, in the trading-server folder there are files in .hst format

what should be the format for csv files and how should i convert them to . hst ?

 

It's actually simpler than that, it seems to me.

1. opened bay order, if the price goes down by 10 pips then we open sell,

2.if sell is closed by SL, price starts to work with the bay, if the price goes down again to minus 10 pips, open sell again

If sll is closed by TP, then my EA will do everything right.

I have a question how to post a condition:

1. open bay order, if price goes down by 10 pips, then open sell

2.if sell is closed by SL, price starts working with the bay, if the price goes down again to minus 10 pips, then open sell again

 

Please excuse me if I'm distracting you with a probably stupid question.

I've just started to learn this and have no one to ask for advice.

I have read the manual a few times. I have started an Expert Advisor with the simplest functions, pending orders.

I still do not understand what I have to do to open orders once, and not with every tick.

//+------------------------------------------------------------------+
//| my.mq4 |
//| serjik |
//| |
//+------------------------------------------------------------------+
#property copyright "serjik"


//---- external variables
extern double Lots=0.1; // lot size
extern int StopLoss=0; // stop loss
extern int TakeProfit=10; // profit
extern int int DistanceSet=10; // distance from the order market
extern int int Slippage=3; //price slippage
//----global variables

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{

double ldStop=0, ldTake=0;
double pAsk=Ask+DistanceSet*Point;
double pBid=Bid-DistanceSet*Point;

if (StopLoss!=0) ldStop=pAsk-StopLoss*Point;
if (TakeProfit!=0) ldTake=pAsk+TakeProfit*Point;
SetOrder(OP_BUYSTOP, pAsk, ldStop, ldTake); //

if (StopLoss!=0) ldStop=pBid+StopLoss*Point; //
if (TakeProfit!=0) ldTake=pBid-TakeProfit*Point;
SetOrder(OP_SELLSTOP, pBid, ldStop, ldTake); //



}
//+------------------------------------------------------------------+
//| Order Setting |
//| Parameters: |
//| op - operation |
//| pp - price |
//| ldStop - stop level |
//| ldTake - take level |
//+------------------------------------------------------------------+
void SetOrder(int op, double pp, double ldStop, double ldTake)
{

OrderSend(Symbol(),op,Lots,pp,Slippage,ldStop,ldTake);


return(0);
}
//+------------------------------------------------------------------+



I may have already seen it in this forum, but I don't have enough energy to re-read it.

If someone helps me out, HUGE THANK YOU!

 
Top2n:

It's actually simpler than that, it seems to me.

1. opened bay order, if the price goes down by 10 pips then we open sell,

2.if sell is closed by SL, price starts to work with the bay, if the price goes down again to minus 10 pips, open sell again

If sll is closed by TP, then my EA will do everything right.

I have a question how to post a condition:

1. open bay order, if price goes down by 10 pips, then open sell

2.if sell is closed by SL, price starts working with the bay, if the price goes down again to minus 10 pips, then open sell again

On every tick, check the profit of the open positions and if it is less than or equal to 10 pips, then do what you need to do next
 
serjik77:

Please excuse me if I'm distracting you with a probably stupid question.

I've just started to learn this and have no one to ask for advice.

I have read the manual a few times. I have started an Expert Advisor with the simplest functions, pending orders.

I still do not understand what I have to do to open orders once, and not with every tick.

//+------------------------------------------------------------------+
//| my.mq4 |
//| serjik |
//| |
//+------------------------------------------------------------------+
#property copyright "serjik"


//---- external variables
extern double Lots=0.1; // lot size
extern int StopLoss=0; // stop loss
extern int TakeProfit=10; // profit
extern int int DistanceSet=10; // distance from the order market
extern int int Slippage=3; //price slippage
//----global variables

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialisation function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{

double ldStop=0, ldTake=0;
double pAsk=Ask+DistanceSet*Point;
double pBid=Bid-DistanceSet*Point;

if (StopLoss!=0) ldStop=pAsk-StopLoss*Point;
if (TakeProfit!=0) ldTake=pAsk+TakeProfit*Point;
SetOrder(OP_BUYSTOP, pAsk, ldStop, ldTake); //

if (StopLoss!=0) ldStop=pBid+StopLoss*Point; //
if (TakeProfit!=0) ldTake=pBid-TakeProfit*Point;
SetOrder(OP_SELLSTOP, pBid, ldStop, ldTake); //



}
//+------------------------------------------------------------------+
//| Order Setup |
//| Parameters: |
//| op - operation |
//| pp - price |
//| ldStop - stop level |
//| ldTake - take level |
//+------------------------------------------------------------------+
void SetOrder(int op, double pp, double ldStop, double ldTake)
{

OrderSend(Symbol(),op,Lots,pp,Slippage,ldStop,ldTake);


return(0);
}
//+------------------------------------------------------------------+



I may have already seen it in this forum, but I don't have enough energy to re-read it.

If someone helps me out, HUGE THANK YOU!

Before placing an order you must first check if the order is already there... If it isn't there yet, then it should be placed, and if it is, then don't...