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

 
sannin:

Izdesbyll:
Can someone please finish it in a humane way?

Describe the principle.


We open two opposite orders. When one comes out in profit we close it and open two more opposite orders and so on until we get rich. Only if we have closed a buy order, then we open a sell order first, and then a buy order, if we have closed a sell order - vice versa. (This is in the expectation that there might not be enough money for the second order).
 

Hi.

I really need some advice !

I am drawing a line on a chart. I have t1(price and time) of line start and t2(price and time) of line end (trend). I cannot increase/extend it exactly twice.

I.e. we need to calculate the third line coordinate: t3 (price and time).

The price is not difficult to calculate, but the time... You can't calculate the time.


Thank you!

 
de_leonid:

The price is not hard to calculate, but the time... You can't calculate the usual difference.


The difference in bars?
 
de_leonid:

Hi.

I really need some advice !

I draw a line on a graph. I have t1(price and time) of the start of the line and t2(price and time) of the end of the line (trend). I cannot increase/extend it by exactly two times.

I.e. we need to calculate the third line coordinate: t3 (price and time).

The price is not difficult to calculate, but the time... You can't calculate the time.


Thank you!


Kim has a function:

//+----------------------------------------------------------------------------+
double EquationDirect(double x1, double y1, double x2, double y2, double x) {
  if (x2==x1) return(y1);
  return((y2-y1)/(x2-x1)*(x-x1)+y1);
}
//+----------------------------------------------------------------------------+
 

Good evening !

Please advise how to code the following idea

If an order is closed at stop,

then open the next order with a volume equal to the volume of the last order closed at stop multiplied by 2.


if (isCloseLastPosByStop ()== True) // if the last order was closed at Stop

{

P =????? // volume = volume of the last order closed at stop multiplied by 2


OrderSend(Symbol(),OP_SELL , P ,Bid,1,Ask+1500*Point,Ask-300*Point, "jfh",123 )

}

Thanks.

 
solnce600:

Good evening !

Please advise how to code the following idea

If an order is closed at stop,

then open the next order with a volume equal to the volume of the last order closed at stop multiplied by 2.


if (isCloseLastPosByStop ()== True) // if the last order was closed at stop

{

P =????? // volume = volume of the last order closed at stop multiplied by 2


OrderSend(Symbol(),OP_SELL , P , Bid,1,Ask+1500*Point,Ask-300*Point, "jfh",123 );

}

Thank you.


Do you mindlessly use Kim's functions, or do you understand what Igor has in them? The answer to your question depends on that
 

OK, long time no answer, I'll give you a hint: when returning true value from isCloseLastPosByStop () function, return one more value, which is the lot size of the last position found.

How to do? Pass a variable into the function by reference, in which you will write the lot size in the function itself. To do this you will need to slightly modify function isCloseLastPosByStop ()

If you don't understand anything - look for a function that will return the lot size of the last closed position. Or you can create it yourself. And use it, but this is more expensive than passing the lot value together with true

 
Got it. Thank you.
 

Good afternoon.

Please advise how the following can be implemented:

The price moves between 1.9047 and 1.9080 (figures are arbitrary). If the opening price of the next candle moves out of this range - give out an Alert. If it doesn't - wait for the next candle. And so until the price leaves the range.

Thank you in advance.

 
Atlis:

Good afternoon.

Please advise how the following can be implemented:

The price moves between 1.9047 and 1.9080 (figures are arbitrary). If the opening price of the next candle moves out of this range - give out an Alert. If it doesn't - wait for the next candle. And so until the price leaves the range.

Thank you in advance.


   if (Open[0]<1.9047) Alert("Цена ниже заданного диапазона");
   if (Open[0]>1.9080) Alert("Цена выше заданного диапазона");
This is just a concept. There will be alerts on every tick if the condition is met.
Reason: