Question for connoisseurs - page 16

 
Daiver2 писал(а) >>

....

The question is, what have I done wrong in the switch statement, why isn't the message *Expert not working* displayed, and why does the EA really stop working?????

If you want the bar insufficiency message once, you can do so:

static int x=0;

if( x<2){
   if(Bars< A){
         if( x==0){
            Alert("Недостаточно баров");
            x=1;
         }
      return(0);
   } 
   else{
         if( x==1){
            Alert("Достаточно баров, начинаем работать");
         }
      x=2;
   }
}
 
Integer писал(а) >>

If you want the insufficient bars message once, you can do so:

>> Thank you.

 

Good afternoon.

It is known that some brokerage companies buy/sell futures instruments not at the price we see on the chart. It is known that some brokerage companies buy/sell futures instruments not at the price we see on the chart, but at the Ask and Bid prices of ticker #I

I made an Expert Advisor that displays on a chart (e.g. ) FDAX graphically (lines) and additionally writes in the corner of the ticker price FDAXHO#I

And now you can see at which actual price a position will open.

However. A considerable misunderstanding was soon detected.

For the ask and bid prices of the ticker FDAXHO#I change much more frequently than the price of the FDAXHO itself.

And it turns out that on the FDAXHO chart in the absence of quotes - the ticker price also "freezes" (although they are changing at the same time) ! And change only with the arrival of the next quotation FDAXHO.

But during this time, the FDAXHO#I has already changed several times, but we have not seen it on the chart of FDAXHO !

How can the situation be corrected here ?

So that FDAXHO#I Ask and Bid prices change dynamically on the FDAXHO chart - even if the quotes on FDAXHO do not come in ?

I hope I put the question in a sensible way. Has anyone encountered a similar problem ?


РТ




 
leonid553 >> :

I hope I put my question in a sensible way. Has anyone come across a similar problem ?

There are two solutions:

1. Loop the Expert Advisor. At the end of each cycle do RefreshRates();

2. Send to the window an event on arrival of a new tick - the same loop, only more (right | wrong - choose the right one).

 

Unfortunately, with my modest knowledge I can't "loop" the expert yet.

Please, show me how to do it in this code "in fact" *

 
leonid553 >> :

Unfortunately, with my modest knowledge I can't "loop" the expert yet.

Please, show me how to do it in the code "by the fact" *.

start()
{
   while(true)
   {
   
      ...
      ... // тело ф-ии start()
      ...
   
      sleep(1000);
   }
}
 
Martingeil >> :

>> Pfft.

void start()
{
   while(!IsStopped())
   {
      RefreshRates();
      ...
      ... // тело ф-ии start()
      ...
   
      Sleep( нужное кол- во мсек);
   }
}
 

Thank you. Got it. Seems to be working fine.

Ticker #I prices are changing regardless of the price hovering on the chart.

 

Martingeil писал(а) >>

Can you tell me how to write the Fibo in the EA?

Judging by the code, first one should find the last two tops of the zigzag and jump from them. Look at Igor's thread, there should be corresponding functions there.
 
leonid553 >> :

Good afternoon.

It is known that some brokerage companies buy/sell futures instruments not at the price we see on the chart. The buy/sell of futures instruments is not done at the price we see on the chart, but at the Ask and Bid prices of ticker #I

I made an EA which on a chart (eg ) FDAX ...... writes in the corner of the ticker price FDAXHO#I




Hi all !

Please advise. I want my EA to display the ticker name FDAXHO#I in comments when I place it on a chart (eg FDAXHO)

It's already done, but I have to manually set in EXPERT'S PROPERTIES the name of this ticker.

In other words, now it's done like this:

//---Внешние параметры советника---
extern string    Tiker  = "FDAXH0#I";//наименование
//-------------------------------------------

//-------------------------------------------------
int start() {
 
Comment (//отображаем цены на графике
"Инструмент  = ", Tiker);
... ... ...

I don't know how to make it return automatically the name of symbol on which chart (e.g. FDAXH0) the EA is set and how to append "#I" to this name ?

Please elaborate on ....

Reason: