Highest and Lowest of a number of candles: Programming support

Forums ProRealTime English forum ProOrder support Highest and Lowest of a number of candles: Programming support

Viewing 14 posts - 1 through 14 (of 14 total)
  • #38495

    Hi everyone,

    As you can see, I am new in PRT coding, and I am trying to determine the highest and lowest of the last 16 candles (M15) before 090000 to create a canal, but I don’t really know how to determine these values. I have tried with the function highest and lowest, but I have problems to determine the period from 050000 to 090000. I am feeling embarrassed because it is a simple problem compared to the level of programming I am seeing in the forum, but I would appreciate any help on this.

    Thanks in advance,

    Best, Juan

    #38498

    Maybe like this?

    #38510

    Hi Despair,

    Thanks for your prompt reply. I am trying to build a very basic system for FOREX in which building a channel (16 candles of 15min) from 050000am to 090000am, and then wait until any candle after 09:00 breaks (with its candles’s close) the inferior (Lowest) or superior limit (Highest), with the idea to scalp 6-8 pips daily.

    The problem is that the channel seems to be attached to the price. In other words, that at 09:30, 09:45, 10:00, etc the system is still creating a channel with the previous 16 candles. Either that, or that I don’t know how to limit the number of operations.

    I am also trying to limit the operations to 1 a day from 090000 to 140000. But, I don’t know how to limit the entries (long or short) to just one. I have DEFPARAM CumulateORders=False, but the moment that one order is complete, it opens another one.

    I know this is too much to ask, but I am stuck here, trying to find the info on the Internet but the only place I receive any answers is here, from either Nicolas or you.

    Thanks so much in advance,

    Juan

    #38512

    Sending the code, I am sure I have screwed it up.

    #38519

    Hi everyone! Solved the Channel high and low. Thanks Despair. I think I wrote something wrong!!

    Just need to solve the one operation per day. Right now, the system launches one buy/sell after another. I would like to buy or sell on the breakout and that is. I am searching on the topics about this subject, so if anyone can redirect me, I would appreciated it.

    Thanks!!! 🙂

    Juan

    #38520

    Hi guys, someone can help me?

    i would say to the TS :

    if i am LONG and time >= 020000 and time<= 040000 close the trade if the price is less then lowest of  ID pattern (high<high[1] and low>low[1]), if between  020000 and 040000 the condition witn ID pattern does not happened , close the trade at 030000

    thanks in advance

    Vincenzo

    #38525

    Juan: Post your code with the <> symbol here not as picture. Then i will fix it. 🙂

    #38529

    Hi Despair,

    I am a little dumb today. I am trying to paste the code here as a text, but I got it in black/white, not coloured/linked as in PRT. My Mac does not convert the itf, and I follow the instructions of <> but it is still b/w. :(((((

    As I mentioned, this is my first code. Although I am reading the manuals, there are some specifics that are not mentioned anywhere.

    I am trying to build a simple FOREX Breakout system in TF=15′ with a channel from 05:00 to 09:00h, and then wait until the breakout, and wait for the close of the candle breaks the highest or lowest and will launch an order long or short depending the direction at the beginning of next bar. TP=8, SL=8, as you can see it is not very ambitious, but enough to start practising and learning the ropes.

    The most important is that I want this to happen just once a day. Once breaks and either win or loss, no more operations for the day. The system will shut-down at 14:00h, which gives plenty of room for one single trade. 

    Knowing how to program this simple task, will give me the resources to include other features or ideas in the future.

    The channel seems to work, although I have been trying to include the limitation of one trade per day, and I might screwed up again.

    Any suggestions will be welcome.

    I don’t know how to thank you for this!!! Thanks so much. I owe you big.

    Juan

    #38537

    Hi Juan,

    I think the code above does what you want (I did not test it though). BTW If you prefer me to answer in german, write in the german forum. 🙂

    #38538

    Hi guys, someone can help me? i would say to the TS : if i am LONG and time >= 020000 and time<= 040000 close the trade if the price is less then lowest of ID pattern (high<high[1] and low>low[1]), if between 020000 and 040000 the condition witn ID pattern does not happened , close the trade at 030000 thanks in advance Vincenzo

    sorry, i do a correction :

    if i am LONG and time >= 020000 and time<= 040000 close the trade if the price is less then lowest of ID pattern (high<high[1] and low>low[1]), if between 020000 and 040000 the condition witn ID pattern does not happened , close the trade at 040000

    thanks in advance Vincenzo

    #38540

    Hi Despair,

    Thanks a lot for the code and for your effort. I have tested and it seems to be better but all the operations are neutral. I have checked the graphics and all are neutral. And I still launch 2 or 3 buy/sell during the same day.

    In any case, thanks so much for your help. I think I can take it from here. I think it just needs some adjustments, and I hope will have by today or tomorrow. I will let you know the result.

    BTW, thanks for the German offer, but I am Spanish. Just moved to Hamburg few months ago for family reasons, and I am still have a very basic level of German 🙂

    Have a great day!

    Juan

    #38542

     

    You are right, the one “endif” was at the wrong place. Now the code shall only take one trade per day.

    #38555

    <pre class=”lang:probuilder decode:true “>// FOREX BREAKOUT
    // 15 MIN
    // One order per day, from 09:00h. The system shuts-down at 14:00h
    // Everyday Channel formation from 0500 to 0900 (Highest-Lowest)
    // Maximum-Minimum Channel Amplitude 32pips-12pips

    DEFPARAM CUMULATEORDERS = false

    // OPERATIONAL TIME
    DEFPARAM FLATBEFORE = 090000
    DEFPARAM FLATAFTER = 140000
    Operationaltime = TIME > 090000 AND TIME < 140000

    // ONE TRADE PER DAY. It resets the variable each new day
    IF INTRADAYBARINDEX = 0 THEN
    alreadytraded = 0
    ENDIF

    // RANGE between 0500h to 0900h
    IF TIME=090000 THEN
    channelhigh = Highest[16](high)
    channellow = Lowest[16](low)
    ENDIF

    // NO ACTIVITY if the channel highest and lowest is >= 32 pips and <= 12 pips
    IF channelhigh-channellow>=32*pipsize OR channelhigh-channellow<= 12*pipsize THEN
    tradeok=0
    ELSE
    tradeok=1
    ENDIF

    // BREAKOUT Conditions
    c1= close > channelhigh
    c2= close < channellow

    // LONG Positions-Opening
    IF Operationaltime AND tradeok = 1 AND c1 AND alreadytraded = 0 THEN
    BUY 1 CONTRACT AT MARKET
    tradeok = 0
    alreadytraded = 1
    ENDIF

    // SHORT Positions-Opening
    IF Operationaltime AND tradeok = 1 AND c2 AND alreadytraded = 0 THEN
    SELLSHORT 1 CONTRACT AT MARKET
    tradeok = 0
    alreadytraded = 1
    ENDIF

    // STOP & PROFIT
    SET STOP LOSS 8*pipsize
    SET TARGET PROFIT 8*pipsize

    Hi Despair,

    Now is working perfectly. I have included a different modification that I got from a past post from Nicolas and now only trades once a day.

    Thanks so much for your help!!!

    Juan

    #38556

    I hope that now is coloured!!! 🙂

Viewing 14 posts - 1 through 14 (of 14 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login