Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1564

 

In principle, it doesn't really matter how the swap or commission is calculated, as long as the amount

OrderProfit()+OrderCommission()+OrderSwap()
is always more than "0".
 
Maxim Kuznetsov:

literally the first google entry for "swap calculation"


there (in the google-index) in varying degrees of popularity why this is the case

I wonder at what parameter values and what parameters can swap become positive if this formula is followed?

MakarFX:

Basically it doesn't really matter how the swap or commission is calculated, as long as the amount is positive.

has always been more than "0".

Yes, especially if market is stagnating when market is open and price is not fluctuating very much but swap and commission is dripping and dripping again... :)

MakarFX:

Dealing centres sum up internal transactions and output them to the interbank market (if they are output) and, correspondingly, a swap is charged on these transactions, and the commission is a payment for dealing services.

If a dealer does not take commission, then either they are a "kitchen" or they aggregate internal deals and take one to the interbank.

For example: they have a total of 50 lots EURUSD for selling and 30 lots for buying, they withdraw 20 lots for selling at the Interbank.

You would pay for swap of 20 sell lots and get swap of 80 lots (50 sell and 30 buy).

Clearly, dealing desks are never at a loss... But how is it more profitable, to take trades to the interbank or to pay out the winnings yourself and keep the loss. I think the advantages of the second option are obvious... :)

 
Mihail Matkovskij:

I wonder at what parameter values, and what parameters, can the swap become positive if this formula is followed?

Well, yes. Especially if the market is stomping around in the open on a big juice trade, the price fluctuates insignificantly, and the swap and commission are dripping and keep dripping... :)

Clearly, dealing desks are never out of luck... But what's more profitable, to take trades to interbank or to pay out winnings and keep losses. I think the advantages of the second option are obvious... :)

"Kitchens don't pay out anything - it's usually a pyramid scheme (MMM).

 
MakarFX:

"Kitchens don't pay out anything - it's usually a pyramid scheme (MMM)

If this is the case, who would want to become a client of such a dealing centre?

 
Mihail Matkovskij:

If you do that, who would want to become a client of such a dealing centre?

The scammers have a saying: "Looters are not mammoths, they will not die out".

As long as people want to get rich quick and easy, pyramid schemes will flourish.

By the way, here's a fresh one.
 
MakarFX:

Basically, it doesn't matter how the swap or commission is calculated, as long as the amount is

has always been greater than "0".

Why? The amount cannot always be greater than zero. The profit can be either positive or negative.

 
Artyom Trishkin:

Why? This amount cannot always be greater than zero. Profit can be either positive or negative.

so for signals :-)

In those places, the more (by any means) closed in the plus, the more risk-free money has arrived.

 
Artyom Trishkin:

Why? This amount cannot always be greater than zero. The profit can be either positive or negative.

MakarFX:

Basically, it doesn't matter how the swap or commission is calculated, as long as the amount

is always greater than "0".
 
MakarFX:

The global ones are declared here

Thanks for your reply, MakarFX)
I did so, before OnInit().

CIsNewBar* NB_M1;

But in OnInit() I need to create a new object whose constructor receives parameters:

CIsNewBar* NB_M1=new CIsNewBar(p1,p2,p2);

So the object is created twice ? First time in global declaration, second time in OnInit()....
The compiler swears at this

declaration of 'NB_M1' hides global variable -> on the line in OnInit()

see previous declaration of 'NB_M1'

So how do you create a new object in OnInit() so that it is globally visible ?
 
Mikhail Tkachev:

Thanks for your answer, MakarFX)
I did, before OnInit().

But in OnInit() I need to create a new object whose constructor receives parameters:

So the object is created twice ? First time in global declaration, second time in OnInit()....
The compiler swears at this

declaration of 'NB_M1' hides global variable -> on the line in OnInit()

see previous declaration of 'NB_M1'

So how do you create a new object in OnInit() so that it is globally visible ?
I could be wrong, but I think you should only declare globally


int или double   NB_M1;