thx for your input, but the basic logic with the percentage calculation was right or?
so it means that if the price is 1.11 it is 100% of tp and at 1.09 it is 100% of sl ?
thx for your input, but the basic logic with the percentage calculation was right or?
so it means that if the price is 1.11 it is 100% of tp and at 1.09 it is 100% of sl ?
Hey guys,
id like to employ a custom trade management like this:
eg long tade eurusd at 1.10 sl 1.09 and tp 1.11
and if price goes down to 1.095 which in my understanding means 50 % of sl price is reached or? then the ea should add to the position just once while the trade is running and if it goes to 1.105 it should close 50% of the position and so on.
I have set up the following but i have no idea if this is the right way to do this. Any advice is very welcome, thx!
@miro1360 said in unix timestamp to "hh:mm" timestamp:
ok, as I expected, problem is in metatrader (not in fxdreema) ... because if you will get time coordinates from object, it is not working, price is working but time is not ...
this is test EA
https://fxdreema.com/shared/vCdUDU66dand result is this:
you can see, price coordinates are taken correctly, but time/date is not -- with original MQL functions ...
or maybe my way to test it was not okwho know ...
(the same happen for trendline)
I already checked the readings from the object, they work fine! The unix timecode equals the date and time from the object.
If I use fxdreemas way to convert this unix time it works fine, but I need further codesamples that show how I can save the results to variables and work with them and how to split it up further, like you did!
But your version always shows just the current time if I replace the 'unixtime' with my variable 'startobject'.
Okay let me know when you are done checking it pls;)
take a piece of plain paper and draw the candle combination you want to see for a buy order and the combination for a sell order
and define all lines by values
maybe i understand what you want to do
if you want to do this you need to work with tick data or range bars, but be aware that you will run into huge slippage on live accounts if you are trading spikes...
@miro1360 said in unix timestamp to "hh:mm" timestamp:
but where you need this? only in Comment block?
https://fxdreema.com/shared/6N55Sodxd
i tried your version and i have to admit this just shows the current time not the time that is saved as an unixtimestamp.
@fxDreema said in unix timestamp to "hh:mm" timestamp:
Well, this is better https://www.mql5.com/en/docs/convert/timetostring
I guess there is no proper way in fxDreema to output time variable, I wonder what can I do about this. But this works: http://prntscr.com/dwzl2t
Your version worked as a comment but as i tried to get it split up further i failed completely and i have no clue how it can be done to save those conversions in a variable to work with it.
Thx for your help!!
Thx I will have a look at it later on today!
But I need it not just as a comment. I'll also need to store it as a time stamp and the date of if it for timer functions and other things.
and how can i setup this function?
that is what i have so far:
fxdreema.com/shared/meHzzqmjd
hey,
i have no clue how i can convert a unix timestamp into a timestamp to work with like "hh:mm"
thx for your answers !
The idea behind this detection is that i want to trade a certain level for a day long and another level short.
So i need to see how the last trade ended up. If the buy Trade hit the TP a defined number of times i dont want to trade any buy trades from this level anymore today. But if it was stopped out by a Trailing Stop i might want to reenter a pending order position if some criterias are matched and if it hit for example twice the SL a day i also dont want to enter any more pending buys for this day.
Do you see now why i need to know this?
So if i go with the trade closed by SL and TP parameters i need do filter the SL Trades into real SL and TS hit. Since TS is also Stoploss but for buy SL>open price and for sell SL<open price I think i can do it like this or?
https://fxdreema.com/shared/yAB90mOBd
So if this is right and this counts the number of each trade how it ended. I need to reset the Variable V1/V2/V3 etc.. on a daily basis so it starts a fresh count each day ? probably this is an on time- modify variables - to 0 - function?
I am trying to get an ea that:
runs from a defined start time to an end time
opens pending orders at a certain time of the day
checks how each trade ended up (TP/SL/TS)
Counts for each pair it runs on the number of TP SL TS trades of today
If the amount of trades are under a certain value the ea should check:
6a) if since the last closed buy trade of the pair the price opened and closed above a certain level and if this is true it should place a new pending order at a certain level
6b) if since the last closed buy trade of the pair the opened above a certain level and if this is true it should place a new pending order at a certain level
7a) if since the last closed buy trade of the pair the price opened and closed above a certain level and if this is true it should open a new order if the price closes at a maximum amount of pips above a certain level a new buy order
7b) if since the last closed buy trade of the pair the price opened above a certain level and if this is true it should open a new order if the price closes at a maximum amount of pips above a certain level a new buy order
i have no problems with 1 and 2. I also tried to work with a loop but this didn’t work.
So i would be very grateful if i could get some help for points 3-7, thank you

EDIT:
Here is what i have so far but it still doesnt seem to work 