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

 
hoz:

I usually send orders by separate functions. I would like to optimise this, so that I can send both pending and market orders with one function.

Please, advise how to implement it correctly?

When sending pending orders, we should check opening price above (below) the Bid price and take into consideration some other aspects.

Let's look how others do it. Let's take the simplest variant used by Kim:

He does not check anything at all. We can see that his function is intended only for opening market orders.

I don't think this is logical. If you send an order, it will be of any type. If you write it the way I think, it will be too long, at first glance.

In general, please let me ask for help and hints on how to implement these points better.

Well, Igor's function performs the very task indicated in the function name. All adjustments and checks need to be done BEFORE calling this function. After all, the function itself only does the task assigned to it - it opens the position with the parameters passed to it (into the function) and nothing more. It does it perfectly well with all necessary error handling. What is missing - develop it yourself.

By analogy: when you buy instant coffee in a shop, the boiling water and sugar and automatic mixing of other ingredients is not offered to it - you better know how to make your own coffee.

 

Folks, is it possible to... Please rewrite under a different loop condition...

That is, there is a wonderful bbands_stop indicator:


for (shift=Nbars-Length-1;shift>=0;shift--)

{

smax[shift]=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_UPPER,shift);

smin[shift]=iBands(NULL,0,Length,Deviation,0,PRICE_CLOSE,MODE_LOWER,shift);

if (Close[shift]>smax[shift+1]) trend=1;

if (Close[shift]<smin[shift+1]) trend=-1;


bsmax[shift]=smax[shift]+0.5*(MoneyRisk-1)*(smax[shift]-smin[shift]);

bsmin[shift]=smin[shift]-0.5*(MoneyRisk-1)*(smax[shift]-smin[shift]);

if (trend>0)

UpTrendBuffer[shift]=bsmin[shift];

else

DownTrendBuffer[shift]=bsmax[shift];

}

Is it possible to write a code similar to the results of the previous one. But for a loop:

for(i = 0; i <= limit; i++) {

For the second day I've been sitting here; I cannot find it...

 
Hi all, of course the question is stupid, how much is the lot size needed to make 1 pip worth 1 dollar?
 
0.1
 
FEAR:
Hi all, of course the question is stupid, how much is the lot size needed to make 1 pip worth 1 dollar?
It depends on the lot size.
 
nikelodeon:
0.1
not always
 
PapaYozh:
not always
Depending on the shoulder....
 
0.1 at 1:100 leverage
 
nikelodeon:
Depending on the shoulder....

nikelodeon:
0.1 with a leverage of 1:100

Shoulders are irrelevant when it comes to item style.

 
FEAR:
Greetings to all, of course the question is stupid what is the lot volume needed to make 1 pip worth 1 dollar?
Depends on what leverage (1:100 ?), how much 1 contract (1=$100,000 ?), what currency pair (EURUSD ?)