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

 

Hey, guys.

My question to you is this: I trade on daily charts. My broker and I have a 4-hour difference. I only open a position after the daily candle closes. But it's 4 am in my city. Naturally, I am still sleeping. Can anyone suggest a script or an Expert Advisor that will efficiently open an order at a certain time of the terminal and at certain price conditions? For example, I need to open a buy order (at the market price - it will be the open price of the next candlestick), if the close price of this candlestick will be in the range from .... to.... Thanks in advance.

 

Please advise how to set a 1-2 second delay before the required condition is executed.

I need the condition to be executed only 1-2 seconds after the order is placed. How do I do that?

 
pasha5282:

Please advise how to set a 1-2 second delay before the required condition is executed.

I need the condition to be executed only 1-2 seconds after the order is placed. How do I do that?


Sleep(1000)
 
hoz:

Yes, so what?

There are a number of limitations when working in visualisation mode
 
solnce600:

Good evening, all!

I want to use the Fun_New_Bar() function (I took it from the tutorial by Sergei Kovalev) to detect the beginning of a new bar and open an order at opening price of a new bar.

But the compiler screws up the line (marked in yellow) and writes'(' - function definition unexpected

I would be very grateful to anyone who can tell me - what does he mean?

Please put the function itself outside int start().

Also divide bool New_Bar=false; into two parts and put the definition of bool New_Bar; right after the external variables,

and leave New_Bar=false; in the main function body.

 
Roger:

Put the function itself outside int start().

Also divide bool New_Bar=false; into two parts, put the definition of bool New_Bar; right after the external variables,

and leave New_Bar=false; in the body of the main function.

Thank you very much for your help.
 

Chiripaha:

... когда я переключаюсь с одного тайм-фрейма на другой, то все настройки сбрасываются на базовые.

Возможно как то избежать этого момента? Как это сделать? По форуму поиском полазил - ничего не нашел.

granit77:

Try unchecking the "Disable EA when changing profile" box in the settings, and see if it helps.

And there you have it. Although, having reread the help on this parameter several times, the answer was far from obvious.

Thank you very much!

 

Why does this happen?

At the opening of an hour bar I open a pending order in the tester with parameter expiration = 1 hour.(3600) OrderSend(Symbol(),OP_BUYSTOP,0.1,Price,3,SL,TP, "SUDF",237,TimeCurrent( )+3600);

Model - by bar opening prices. And pending orders are deleted if they are not converted to market orders after 1 hour.

Then I want to do the same on five-minute chart. The model is based on bars' open prices.

At every five-minute chart open I want to place an pending order, and if it is not opened within 5 minutes, delete it.

I.e. expiration = 300 OrderSend(Symbol(),OP_BUYSTOP,0.1,Price,3,SL,TP, "SUDF",237,TimeCurrent( )+300);

But in this case the pending orders are not set due to error N3 (wrong parameters)

Please advise me where I am wrong.

Thank you.

int start()

{
double Price=Ask+30*Point;
double SL=Price-30*Point;
double TP=Price+15*Point;

if (Time[0])
OrderSend(Symbol(),OP_BUYSTOP,0.1,Price,3,SL,TP, "SUDF",237,TimeCurrent( )+3600 );


}

 

Can you tell me if it is possible to paint the body of the desired candle in the EA?

 
solnce600:

Why is this happening?


Please tell me where I am going wrong.


Each brokerage company has its own "minimum lifetime" of the order. That's why it does not give on 5 minutes.