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

 
Chiripaha:

No, it is not easier. Because if there was a negative flag (or a global variable), the check still needs to be run. Both the flag and the global variable will only work in the positive case. And some functions are still needed at start (although, it's different here).

Whichever way you look at it, startup still needs to be run anyway: either through replaying "inite", which is just as annoying, or through replaying required functions.


You're doing something so complicated that it's almost impossible to comprehend...

Tell me, what's the difference in return of a value by a function, or a global variable which changes in the function, the result of which must be returned? In this case "inite".

 

Colleagues, what is the error?

//========================================================================================================//     
                                             //---- SELL ----//
//========================================================================================================//

if(OrdS<=OrederSell) 
  { //----- start

if(.........)
  
{ticketSell=OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,0,0,magick,0,Blue);OrdS++; Этот ордер открывается
Sleep(3000); RefreshRates();
 ticketSell2=OrderSend(Symbol(),OP_SELL,0.2,Bid-20*Point,3,0,0,0,magick,0,Blue);OrdS++; Ошибка 138 или OP_SELLLIMIT - 130
 Sleep(3000); RefreshRates();
 ticketSell3=OrderSend(Symbol(),OP_SELL,0.4,Bid-40*Point,3,0,0,0,magick,0,Blue);OrdS++; Ошибка 138 или OP_SELLLIMIT - 130
}
 
  } //-----end
          
//========================================================================================================//  
                                             //---- BUY ----//
//========================================================================================================//  

if(OrdB<=OrederBuy)
  { //-----start

if(.........)

{ticketBuy=OrderSend(Symbol(),OP_BUY,0.1,Ask,3,0,0,0,magick,0,Red);OrdB++; Этот ордер открывается
Sleep(3000); RefreshRates();
 ticketBuy2=OrderSend(Symbol(),OP_BUY,0.2,Ask+20*Point,3,0,0,0,magick,0,Red);OrdB++; Ошибка 138 или OP_BUYLIMIT - 130
 Sleep(3000); RefreshRates();
 ticketBuy3=OrderSend(Symbol(),OP_BUY,0.4,Ask+40*Point,3,0,0,0,magick,0,Red);OrdB++; Ошибка 138 или OP_BUYLIMIT - 130
}

I've already checked the forum for 130/138 error, but I still don't understand why additional orders 2 and 3 don't open. Only the main ones.

 
NORMALISATION
 
Fox_RM:

Colleagues, what is the error?

I've already checked the forum for 130/138 error, but I still don't understand why additional orders 2 and 3 don't open. Only the main ones.

Colleague, you want to open market orders not at market price... :)
And it does not hurt to understand the difference between limit orders (SELLLIMIT and BUYLIMIT) and stop orders (SELLSTOP and BUYSTOP).

 
TarasBY:
Colleague, you want to open market orders not at the market price... :)

And indeed
 
Good afternoon. There are two points with coordinates (x1,y1) and (x2,y2). How can I use these two points to build a logarithmic function with a logarithm basis other than natural? Seems like I need to use inverse function(MathPow), but I can't figure out how to make it diagonal. If someone has faced with it, please advise. Thanks in advance.
 
hoz:

So there's no end to the cycle, that's why it's stalling.

What's the right way to end it?
 
Chiripaha:

No, it is not easier. Because if there was a negative flag (or a global variable), the check still needs to be run.

Not all the same.

Chiripaha:

Both the flag and the global will only be triggered in the positive case. And some functions are still needed in Start (although, it is different here).

If there is a connection break or something like that, the flag will take on a different meaning. You have to decide how to create the right conditions for it.
 
Krokus:

What's the right way to end it?
It goes something like this:
int i, countedBars = IndicatorCounted();
        
    for(i = Bars - countedBars;i > 0;i--)
    {
      pointOfMaFirst = iMA(Symbol(),maTF,maPeriod,maShiftByPrice,maMethod,maPrice,shiftBarsBack1);
      pointOfMaLast = iMA(Symbol(),0,maPeriod,maShiftByPrice,maMethod,maPrice,shiftBarsBack2);    
    }
 
TarasBY:

Colleague, you want to open market orders not at the market price... :)
It would also help to understand the difference between limit orders (SELLLIMIT and BUYLIMIT) and stop orders (SELLSTOP and BUYSTOP).


Can I ask you what you mean by not at market price? With SELLLIMIT and BUYLIMIT, everything is correct.