[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 259

 
belck:

I can't figure out how to make the lines display, either by this script or by pushing away from this script, or maybe I'm wrong:

that is, when this price reaches this level, the orders are closed, and I want to see this price on the chart as a line or a small record in a square and with a dash.

Point me in the right direction!

Where do you draw the lines in your code?
 
forexnew:

How is it possible to be on the profit, if the orders are equal in the lot size?

Here the calculation is based on price inertia. I.e. stop loss of the first order is triggered, the second order is at a profit with a value a little less than the loss. If the price moves in the same direction some more, then yes, we may be in the total profit.

But the strategy is not worth a bite.

 
sergeev:

where in your code do you draw lines?

Well, there's one right there:

ObjectDelete("SLb");
   if (b!=0) 
   {  SLb = (price_b/lot_b)+TakeProfitBuy * Point;
      ObjectCreate("SLb",OBJ_ARROW,0,Time[0],SLb,0,0,0,0);                     
      ObjectSet   ("SLb",OBJPROP_ARROWCODE,6);
      ObjectSet   ("SLb",OBJPROP_COLOR, Navy);
   }
   ObjectDelete("SLs");
   if (s!=0) 
   {  SLs = (price_s/lot_s)-TakeProfitSell * Point;
      ObjectCreate("SLs",OBJ_ARROW,0,Time[0],SLs,0,0,0,0);                     
      ObjectSet   ("SLs",OBJPROP_ARROWCODE,6);
      ObjectSet   ("SLs",OBJPROP_COLOR, Maroon);
   }
 

Hi guys, can you tell me how to make it so that:

If the price fell below the low of the previous bar immediately set a sell order?

For example if bar low[1] = 1.4000. And the price of the current bar has fallen below e.g. 1.39995 - an op_sell order is set instantly

 
paukas 13.10.2011 15:03
ikatsko:
Does anyone have a ready-made "Skip next bar" function? :)

if(iTime(Symbol(),period_bar,number_of_bars_to_skip)>OrderOpenTime()

Skips the number of_bars_to_skip

0 - skip current one, 1 - current one and next one etc.

Obviously I put the question incorrectly. I wanted the following: the command (some parameter generated by the program) skips the next bar (or several following bars) and then the program continues its usual execution until the next command to skip a bar appears.

What I don't understand from this code is that iTime will give me the time value of the bar opening offset from the current bar by the number of_ bars_to_skip. This means that the time thus obtained will always be lower than the current time. With each new bar, it will also be shifted upwards. And all this is tied to OrderOpenTime??? So? How will it work for bar skipping?

 
sergey_r:

Hi guys, can you tell me how to make it so that:

If the price fell below the low of the previous bar immediately set a sell order?

For example if bar low[1] = 1.4000. And the price of the current bar has fallen below e.g. 1.39995 - an op_sell order is set instantly

int Tiket;
double кол-во лотов, стоплосс, тэйкпрофит;
if (iClose(NULL, 0, 0)<iLow(NULL, 0, 1) {Ticket=OrderSend(Symb,OP_SELL,кол-во лотов,Bid,3,стоплосс,тэйкпрофит);}
 
Thank you. Got it all.
 
mInvIn:



Yes, but my order is placed at the close of the bar, while I need the current price. If the current price has fallen below the low of the previous bar... And here it happens only if the price has closed below the previous low then the order is set
 
There is an unclear situation in S. Kovalev's book. It is about modification of orders, I copied his modification code, ran it for execution. And the orders are modified, but! They are modified even if Take Profit is the same as in the previous modification! But it's written in the book and in the help (and it was said here) that
If unchanged values are passed as parameters to the function, an error 1 (ERR_NO_RESULT) will be generated. <br / translate="no">.
What is this strange situation? Please explain.
 
ScioMe:
There is an unclear situation in S. Kovalev's book. We are talking about modification of orders, I copied his modification code, ran it for execution. And orders are modified, but they are modified even if Take Profit is the same as in the previous modification! And it is written in the book and in the help (and it was said here) that this situation is not clear, please explain.

If SL(target) is changed, then the order values for the modification are changed.