candle count
-
Hi
i want to count number of candle to put sl in highest and lowest pries of two past cross of kijunsen and tenkensen line .+3pips abow highest for sell or -3pips than lower pries in buy.the range of candle count for high or low prise is my problem. this is my example link but it doesn't work would you guide how to do that.
https://fxdreema.com/shared/9N0JyTCPc
-
I don't think you need to use x< just <, this is because a cross happens over time, and you are looking at a fixed moment in time.
-
let show in picture what happens .i tested it. when i use < i have number of candle part 2 but i want the number of candle in part1 as you can see in picture.
-

-
I an not sure what you mean, this is giving me the ID:

-
-
I mean this just shows last cross of ten and kijun and distans to live of market( 46 candle in picture) but i want the cross befor that and distans to live of market (56 candle in the picture)
how can i get that? -
Every time there is a cross save the time (or draw a line), and then you will have every cross recorded
-
i appreciate for your time and answer . may you give me a example?
-
Try this, it uses custom code to do it, the variables contain the time: https://fxdreema.com/shared/skHK4mz5c
-
Thanks a lot a test it and it was wonderful. there is two point i need to consider.1- sometimes this cod doesn't draw line and make mistakes how can we correct it?( picture one)
i use my setting in ichimoku .kijun=216 ten=108 and some times it draw just a line and haven't 2 lines. i want to put candle id number in stop loss setting as income numbers to have highest and lowest pries for sl setting Did i do it right in this link?
https://fxdreema.com/shared/PKRQDx6Pb -

-
Sometimes the MetaTrader indicators won't work with too low a number, add 2 int variables and this code to the bottom of the existing code:
Variable1 = iBarShift(NULL,0,lastKijunTenkanCross1,true);
Variable1= iBarShift(NULL,0,lastKijunTenkanCross2,true);This should put the time IDs into the variables
-
thank a lot. I did it about code and varieble. But it didnt work. Coud you look at it and say my mistake?
-
This does, the -1 is because only 1 cross has happened: https://fxdreema.com/shared/gP74GFdic

-
-
Try this one: https://fxdreema.com/shared/uScuo8Pcd
-
Thank you so much. It is wonderful dear @jstap !! I appreciate so much.
some times it passes to many candle and we have limitations of 500 candle in loop and some times cross 2 is = -1 it happens very few times but dangers to happen even once. how we can say if this happened consider cross1 and 200 candle before( to obtain highest and lowest for sl)
and when trade closed by stoploss ea doesn't open a new trade untill tenkensen kijensen new cross? -
fort part 2: if buy stopped wait for cross ten above kijen and if sell stopped wait for ten cross below kijen i tried turn off blocks but wasn't successful

