very simple request if you can help with this!
-
Hello all ,
I am new to fxdreema and making EA . I just wanted to know how to get the high and lows from a group of candles. Say i want to get the high and low from the group of candles from 4am to 8 am and then buy or sell when the price breaches high or low . I am just stuck with getting the high and low part .Any help or suggestion or showing me how to do it would be very kind of you all .
Long live the fxdreema community!
-
@reader1 Hi! Try this condition

-
@ambrogio thank you so much . so much appreciate this . that was what i exactly needed. thanks a million ambrogio.
I will be asking lots of quesions in future . you are very helpful and knowledgeable! -
@reader1 you're welcome
-
@ambrogio morning. so i was trying to create a very simple breakout box ea. after your suggestion above i managed to build a working one. how do i put the stop loss as value of half of the box (sl = low + (high-low/2)), this formula will work for both buy and sell. i am new with variables. right now i could only put stop loss as low of the period for buy and high of the period for sell as you can see in pic.


please advise me i am sure there is a simple way . thank you so much in advance -
@reader1 this is an example

-
@ambrogio thanks again . yes that is absolutely what i need . the difference in price has been turned to the pips then /2 and then that is used as stop loss. but why *10000. can i use that number for any/all pairs .
-
@reader1 Because I turned pips the price level (useless), so below is better so that you do not have problems with YEN pairs


I've not tested
-
@ambrogio so i managed to sort that issue out ( stoploss half the box ). what i did was this ( high+low / 2) instead of focusing on high-low and thats it , it gives me exactly what i want as stop loss . i have assembled an EA have a look . tester result were ok not wow ( its just i was obsessed with the breakout box ea for last few days , so i had to finish it this way or that ) . i am putting it through demo tomorrow.
i am a newbie here let me know if there are any mistakes there or if anything could be done in different better way. my plan was to add few filters to this ea ( no trades if the box size is less than 10 pips or more than 50 pips , opening trades only during 8-2 gmt not other times ).
i would not have been able to make this without you showing me how to get the highest/lowest price value from the group of candle so THANK YOU very much .
https://fxdreema.com/shared/eKmveDhfb -
@reader1 Looks fine so far. The only thing I'd do different is to store the relevent prices and SL level in variables. As you let the code run once per tick, that may have a better performance (CPU usage for instance).
-
@reader1 Hi, i've not tested
-
@trader-philipps i agree with you but aren't the variables themselves calculated at every tick and then fed to/used by the main code so cpu still ends up doing the same amount of task . or can the high, low and stoploss be set as variables and not connected to the block save cpu from extra tasks. sorry if i dont make any sense lol i am a newbie .
-
@reader1 Of course you're right. Was somehow thinking you'd check multiple times. However, check the conditions block. You twice use the ask price, what probably is a mistake. I just saw that you use that twice so I thought to look price up and store it in a variable. I guess one condition should have a bid price.
