MA CROSSOVER TIME
-
Please how can i store the time in a variable(eg 16:30) whenever current candle cross MA 100....that is to store the time in this format(eg 16:30) soon as the candle crossed the MA so that i can use the variable in another block.......
i used market properties to get the current time(eg 1714559400.0) whenever the cross happens but i wasnt getting this format(eg 16:30)
This is what i did.....but the time format is not what i want
https://fxdreema.com/shared/CtUxeIxdbHELP PLEASE.....
-
@aster4u You need to use a string type variable:

-
Hi,thanks for your reply.......So i have followed your instruction but am getting random numbers when candle cross MA

Dont really know why.....Please check for me( https://fxdreema.com/shared/hXsl2H91d ), you can share a link....

-
@aster4u
Try using datetime as the data type of the variable. Then print it out in comment block. -
@sktsec
Hi,thanks for your reply.......So i made the change and am getting a readable result.....

Please i only want hour and minutes(eg 17:40) so i can use the variable for Start hour/End hour like the image bellow

-
I think you may need extra work using the function TimeToString() to extract what you need
-
@sktsec
Please how do i do that ?
Am very new to fxdreema and have no knowledge in programming ......started using fxdreema some months ago,
You can do it and share the project so i take a look or copy the blocks
-
@aster4u
Try the blocks for modifying or setting up formulas for variables -
This format 1714559400.0 is seconds after 1970, convert it to string using this line of code: TimeToString(value,TIME_MINUTES)
-
@jstap
Thanks for the reply...
Please how do i set that up ? -
Please how do i set that up ?
-
So you can see how it works, in a comment block, add that line into text code input, replace value with your value, or 1714559400 just for seeing the result. Once you get this working you can use this in many blocks
-
@jstap
Please can you share a link -
Try this:

-
@jstap
Thanks again. Seeing the correct time format now....
Please how do i put this(result) in a variable as the time is updating based on market price and MA crossover ?


-
@jstap
whilst waiting for help, I tried this but the time doesnt update whenever there is a crossover -
@jstap @l-andorrà @sktsec
Solved it by playing around.....
thanks guys

-