Negative Swap Filter?
-
Happy New Year All!
What is the simplest way for me to apply the following condition in fxDreema?:
If the Swap of an instrument is negative, do not open the trade
Any help would be greatly appreciated. Thanks
-
@dre AFAIK the only way is creating an input parameter that can manually be specified as true/false when running the EA on the chart the forst time. I'm afraid there is no block (to my knowledge) in fxDreema that can detect that info automatically.
-
Thanks.
I found this code but I'm not sure if it's useful or how I could implement it to do the above:
SymbolInfoDouble(Symbol(),SYMBOL_SWAP_LONG)
Is this of any use for what I want to do?
I guess I want EA to read the Swap rate and then if it's negative, then do something
Is anyone aware of how we can best do this in fxDreema (i.e. Custom MQL Code, etc)?
-
@dre I am a little lost, I thought swop happened when a trade was already running, when a broker closes 1 trade and swops it for another identical trade, this means swop is never negative before a trade, if it was negative swop that would mean you got a discount from your broker.
-
A 'negative Swap' is when you pay rather than receive interest between the two currencies of the pair that you are holding. That's my understanding.
I mean that I would like the EA to check if the Swap at rollover of a potential entry will be negative. If so, don't open it (as the Swap fee will affect the potential Risk/Reward of the trade, if scalping, for example)
-
@dre I see, I don't know if this is possible.
-
@dre hi! As you said the swap is known at the beginning of the trade, this can be seen in the contract specifications:

The code you have found is right, you could use it like that:

-
@ambrogio Thank you very much - I will give it a try!

-
@ambrogio Interesting. Good job ambrogio!