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

 
abeiks:
What should be the values of prices Price2-Price4?
If a new price arrives that matches the condition then Price1 becomes Ask price, Price2 becomes Price1 price, Price3 becomes Price2 price, Price4 becomes Price3 price.

If Ask<=Price1, what should the program do?
Then nothing happens.

To form a sequence of prices, you can first create a non-dynamic array.

When a new price appears, shift the array upwards to the element number.

The comment function can contain 64 elements, including comma-separated controls.

 
abeiks:
What should the values of prices be Price2-Price4?
If a new price is received that meets the condition, Price1 becomes Ask price, Price2 becomes Price1 price, Price3 becomes Price2 price, Price4 becomes Price3 price.

If Ask<=Price1, what should the program do?
Then nothing happens.
double Price1, Price2, Price3, Price4;

void OnTick()
  {
    if (Ask > Price1)
    {
    Price4=Price3;
    Price3=Price2;
    Price2=Price1;
    Price1=Ask;
    Comment(Price1, "\n", Price2, "\n", Price3, "\n", Price4);
    }
  }
 
silachara:



Thank you!
 
kosmos0975:

To form a sequence of prices, you can first create a non-dynamic array.

When a new price appears, shift the array upwards to the element number.

The comment function can contain 64 elements, including comma-separated control elements.

I assume this is about the same as TarasBY suggested on 25.08.2015 17:22 #. It's a good idea as you can easily add more lines. But the thing is, I don't know arrays myself and can only redo the code that worked. And I couldn't fix TarasBY's code to make it work.
 

Hello all. Can you please tell me.

Can the indicators in the strategy tester work with the order information (OrderSelect(...)) opened by the Expert Advisor

orSimpleFXTester_v2.ex4 (in parallel). In visualization mode. The tandem works in the terminal.

 

Good time!

Who can tell me how to programmatically calculate the number of trading (working) days between two dates?
That is, we need to somehow take into account weekends and public holidays.

Thank you very much in advance).

 
Shuba:

Good time!

Can someone advise how to programmatically calculate the number of trading (working) days between two dates?
That is, you need to somehow take into account weekends and public holidays.

Thank you very much in advance).

There are days when an individual pair doesn't trade because of host holidays.

It's better to count by history. You make a note of the current date. With the onset of a new trading day++;

 

Good afternoon!

Can you please tell me how to write data into a csv file in several lines instead of just one?

 
pmn:

Good afternoon!

Can you please tell me how to write data into a csv file in several lines instead of just one?

What's the matter, I just write a question and come up with an answer myself. Got out of the situation by using several consecutive FileWrite functions.
 
Thanks,kosmos0975!
I'll give it a try. But I'm afraid it won't work on weekly bars, for example.
Reason: