Break even point (Each trade)
-
EDIT,
I got it to work now but i have to disable the input box
Can someone please help me to code it that i can input an variable that will be used to multiply the spread?
If possible i want to manually enter the factor per chart and not hardcodedThanks in advance
Dear forum members
I am using the Break even point (Each trade) block and want to fill it with variable's
1 variable is "MarketInfo(0,MODE_SPREAD)" and the other 1 is a multiply of 5When i put this in an alert message all works fine but when i apply these variables into the Break even point block the EA does not load.
Does any one has an idea of what i am doing wrong?Thanks in advance
-
Can you manually compile or provide the error code when the EA does not load?
It can be that you are putting a space or it's a type issue (variable type)
-
Hi @fxzen
Thanks for your answer
Its working atm but not exactly on how i like
MarketInfo(0,MODE_SPREAD) is giving me back the spread wich is good
I can multiply it also but i want to multiply it with an INPUT BOX
I made 3 variables in my project1 is var1 = MarketInfo(0,MODE_SPREAD)
2 is var 2 = Test (test is getting a value from the formula block)
3 is var 3 that should be var1 * var2
When loading the EA it only places the stoploss at the value of var1 and not var3
What i like to do is getting the current spread and then multply this with a input number using the input boxmaybe the picture makes things clear
As you can see in the variable i am getting the spread (and i can multiply it hardcoded)
But what i like to archive is that i multiply this using an input block ( can be any as long as it works)
So basicly i want the break even point offset to be multiplied X times the current spread
Is this possible?Thanks a lot for helping out

-
@DGRL
I think I understand what you are after, it is a typecasting issue. I'm fairly certain it has to do with trying to do the calculation in the variables section and the way the code is Dynamically generated.Here the order is placed, and the multiple(2 in variable) * spread(8) = 160. So the SL is adjusted by 150 once in 20 pips of profit.
Shared project:
https://fxdreema.com/shared/1eFNI4ZZb
Result:


-
Finally got it to work
Now i have a single input box that will multiply the spread
See pic below
Working like a charm

-
Awesome

-
Thanks a lot
Off topic question if you dont mind
I have a time filter that will close all my trades at friday after 9:30PM servertime
After that i dont want my EA to trad anymore until let say sunday evening or monday morning
I have the first part of closing after 9:30PM on friday
But how do i prevent my EA from opening a new trade after 9:30PM?
See pic for what i have up to now