Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 124

 

Help me find the minimum price of an open SELL order

let's say I opened a SELL order

OrderSend(Symbol(),OP_SELL,GetLot(MaxRisk),NormalizeDouble(Bid,Digits),slippage,SL,TP, "SELL",Magic,0,CLR_NONE);

The minimum price in the history of the open order can be found as follows

min=High[iHighest(timeframe,0,MODE_HIGH,barsearch,0)]

where barsearch is the number of bars you are investigating.

barsearch=Bars - "number of bars at the moment of SELL order opening

how to calculate "the number of bars at the moment of SELL order opening" ???

 
a-zet:

Help me find the minimum price for an open SELL order

let's say I opened a SELL order

OrderSend(Symbol(),OP_SELL,GetLot(MaxRisk),NormalizeDouble(Bid,Digits),slippage,SL,TP, "SELL",Magic,0,CLR_NONE);

The minimum price in the open order can be found as follows

min=High[iHighest(timeframe,0,MODE_HIGH,barsearch,0)]

where barsearch is the number of bars you want to examine.

barsearch=Bars - "number of bars at the moment of SELL order opening

how to calculate "the number of bars at the moment of SELL order opening"?

I think you have some mystery in the question itself...

If there is an open Sell order, what is the minimum price you want? The open price of the order? The price of its stop-orders? Or the maximum drawdown of this position in the history of its existence?

 
artmedia70:

I think you have a bit of a mystery in your question itself...

If there is an open Sell order, what is the minimum price you want? The opening price of the order? The price of its stop-orders? Or the maximum drawdown of this position in the entire history of its existence?


The idea is to close a profitable SELL order if it has fallen to its minimum and then risen by 10%.

if ((current price*100)/(open price - "minimum price in the SELL order history" )>10

Order_Close("SELL");

But how do I calculate the "minimum price in the open SELL order history" ?

I'm not a connoisseur of terms, but by "minimal price in history of an open SELL order" I mean the maximal profit of SELL trade in history (missed profit)



 

Hello, could you please give me a link to a beginner's guide on how to use Teletrade4? I installed it yesterday, opened a demo account, but I don't know how to look there. I would like to learn it at least on the user level.

I would like to learn it on my user`s level, and I have another question. I have just placed an order but all my trades are closed for some reason. I did it last night. I want to buy again and I don't want to buy again.

 
a-zet:

The idea is to close a profitable SELL order if it has fallen to the minimum and then risen by 10%.

if ((current price*100)/(open price - "minimum price in the open SELL order history" )>10

Order_Close("SELL");

But how do I calculate the "minimum price in the open SELL order history" ?

I am not a connoisseur of terms, but by "the minimum price in the history of an open SELL order" I mean the maximum profit of selling SELL in history (the lost profit).

I.e., you need to know the maximum unrealised profit of an unclosed market order. So, find the bar at which the order was opened (the order must first be selected using the OrderSelect() function):

int BarOpenPos=iBarShift(Symbol(),Period(),OrderOpenTime());

And then look for the minimum/maximum price for the period between the current (zero) bar and the bar where the position was opened.

int    BarOpenPos=iBarShift(Symbol(),Period(),OrderOpenTime());            // Бар, на котором была открыта позиция
double PriceMin=Low [iLowest (Symbol(),Period(),MODE_LOW, BarOpenPos,0)];  // Минимальная цена за время жизни позиции
double PriceMax=High[iHighest(Symbol(),Period(),MODE_HIGH,BarOpenPos,0)];  // Максимальная цена за время жизни позиции
Then do what you need to do with the price
 
a-zet:

The idea is to close a profitable SELL order if it has fallen to the minimum and then risen by 10%.

if ((current price*100)/(open price - "minimum price in the open SELL order history" )>10

Order_Close("SELL");

But how do I calculate the "minimum price in the open SELL order history" ?

I'm not a connoisseur of terms, but by "minimum price in history of an open SELL order" I mean the maximum profit of selling SELL in history (lost profit).



I would make it like this:

 int timeframe=PERIOD_M1;// лучше выбрать самый мелкий период
 int shift=iBarShift(Symbol(),timeframe,OrderOpenTime(),false);// бар, на котором был открыт ордер
 if(shift>0) shift=shift-1; //Начнём поиск минимума со следующего бара после бара открытия
 double min=iLow(Symbol(),timeframe,iLowest(Symbol(),timeframe,MODE_LOW,shift,0));//мин. значение цены со времени открытия ордера


P.S. Simultaneous replies)))

 
evgeniy80:

Hello, could you please give me a link to a beginner's guide on how to use Teletrade4? I installed it yesterday, opened a demo account, but I don't know how to look there. I would like to learn it at least on the user level.

I would like to learn it on my user`s level, and I have another question. I have just placed an order but all my trades are closed for some reason. I did it last night. Thanks in advance.

Here are the videos http://forumtrading.com/forumdisplay.php?f=46

All trading is closed because there's no trading on Saturday or Sunday.

 
Sepulca:

I would do it like this:


P.S. Simultaneously replied)))



Thank you both.
 
a-zet:

Here are the videos http://forumtrading.com/forumdisplay.php?f=46

all bidding is closed because bidding is not open on saturdays and sundays

a-zet, thank you very much!

 
Sepulca:

I would have done it this way:


P.S. Answered at the same time)))

I don't get it:

if(shift>0) shift=shift-1;

if open on the first bar, looking from zero to zero?

Reason: