[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 321

 
int start()

  {
   { 
    if (OrdersTotal()<10 && iMA(Symbol(),Period(),30,0,MODE_SMA,PRICE_CLOSE,1)>iMA(Symbol(),Period(),10,0,MODE_SMA,PRICE_CLOSE,1)
     OrderSend(Symbol(),OP_SELL,1,Bid,0,0,Ask-13*Point,"",111,0,Blue);
    }
    {
    if (OrdersTotal()<10 && iMA(Symbol(),Period(),30,0,MODE_SMA,PRICE_CLOSE,1)<iMA(Symbol(),Period(),10,0,MODE_SMA,PRICE_CLOSE,1)
     OrderSend(Symbol(),OP_BUY,1,Ask,0,0,Bid+13*Point,"",111,0,Red);      
     
    }
   }
Where did you go wrong?
 
Evylol:
Where did you go wrong?

and which line are you doubting?
 

I wanted to figure it out myself, but something is still wrong. is it an adequate entry to allow every new day to trade and mash=bid by 00-00?

datetime day =0;

if(DayOfYear()!=day)

{

ma=Bid; day=DayOfYear(); Stop=True;}

 
sergeev:

which line are you in doubt about?
error '\end_of_program' - unbalanced left parenthesis

 
Evylol:
error '\end_of_program' - unbalanced left parenthesis


So it's time to count the brackets
 

Please advise. let's say:

1) the EA throws pending orders along the channel (for buying and selling),

2) But suddenly at this time server will limit the minimum distance of the order from the current price in points.

3) The Expert Advisor will not be able to throw a pending order,

4) But how can I prescribe, so it would still throw the order at the minimum available distance from the channel and the current price.

 
okvseok:

Please advise. let's say:

1) the EA throws pending orders along the channel (for buying and selling),

2) But suddenly at this time server will limit the minimum distance of the order from the current price in points.

3) The Expert Advisor will not be able to throw a pending order,

4) But how can I prescribe, so it would still throw the order at the minimum available distance from the channel and the current price.

Have you read the textbook?
 
Roman.:
Have you read the textbook?
I'm writing something, so I've read it, but tell me the section.
 
okvseok:
I am writing so I must have read it, but tell me the section.
See how to set stops in the extreme function
(Tral_Stop

order modifications) on this page.

You will have - similarly, only the check for min requirements will not be stop levels, but freezing of pending orders - see requirements and limitations...

I.e. when setting pending orders, you also check for min requirements and if they don't match the distance (according to your channel), you set the min allowed level. That's it.

 
Roman.:
See how to set stops in the extreme function (

order modifications) on this page.

You will have a similar situation, only the check for min requirements will not be stop levels, but freezing of pending orders - see requirements and limitations...

I.e. when setting pending orders, you also check for min requirements and if they don't match the distance (according to your channel), you set them to the min level allowed. That's it.


OK. Thanks. I'll try it.