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

 
kokos4:
Help a novice programmer write a script to delete pending orders. Need to delete all pending buy orders when there are no market positions and no pending sell orders.

There is a script to delete all orders. it closes alternately all pending and working bets

 

Good afternoon, please advise how to organise a cycle ONLY for the current day. That is, I need indicator values ONLY for the current day. Calculate the variable A for the current day!!!!

I want to add all the values of the indicator for the current day!

Suggest a loop that can work in this mode.....

 
nikelodeon:

Good afternoon, please advise how to organise a cycle ONLY for the current day. That is, I need indicator values ONLY for the current day. Calculate variable A for the current day!!!!

All indicator values for the current day need to be added up!

Suggest a loop that can work in this mode.....

The beginning of the current day is:

    datetime ldt_BeginDay = iTime (_Symbol, PERIOD_D1, 0);

The number of bars to be calculated on the desired TF:

    int li_Bar = iBarShift (_Symbol, _Period, ldt_BeginDay);

Further you can do it yourself...!

 
Thank you. Made by....
 
I can't figure out how to find out the date of the current bar... I need to find out when the previous bar was yesterday, but the current one is TODAY!!!! I tried to compare times, but it did not work. Maybe there are known solutions????
 
All sorted.... Really a beginner's question :-)
 

Good morning everyone...

On type " if(Volume[0]>1) return; " wanted the following:

 if(iVolume(NULL,PERIOD_D1,0)<1) 
 {
 start1();
 return;
 }
Generally,work on h4 chart, and if new candle is on daily chart, then execute start1(). But it doesn't work that way...
 
Escapee:

Good morning everyone...

on the type " if(Volume[0]>1) return;" wanted the following:

You were the one who wanted to check the opening of the daily candle.

1.if(Volume[0]>1) is always true (except weekend)

2.if(iVolume(NULL,PERIOD_D1,0)<1) is always false, at least one tick is (except for weekend)

To check for the opening of a new bar, it's better to use time. Ticks can also come in packs.

 
Vinin:

You were the one who wanted to check the opening of the daily candle.

1.if(Volume[0]>1) is always true (except on weekends)

2.if(iVolume(NULL,PERIOD_D1,0)<1) is always false, at least one tick is there (except for weekend)

To check for the opening of a new bar, it's better to use time. Ticks can also come in batches

1. By results in the tester I see that, for example, if we take the daily ones, then at 00.00 it performs the specified actions, i.e. volume[0] works. ^_-

 
Escapee:

1. I can see from the results in the tester that, for example, if you take the daytime, at 00.00 it performs the specified actions, i.e. volume[0] works. ^_-

Unfortunately, only in the tester. In life it may not be