Find correct highest and lowest value

Forums ProRealTime English forum ProOrder support Find correct highest and lowest value

Viewing 11 posts - 1 through 11 (of 11 total)
  • #103594

    Hi

    I have just started using Pro Real Code software. I am trying to find Highest value between my last order (sell) and  current position, but endup with wrong result.

    e.g.  I have executed my first previous order on 1000. Before placing 2nd order I would like to know that price had been gone above to 1100 or not. Currently I am using following code.

    Above code return 1175, as graph show that value only increse to 1030.

    As i am new on this platform any help will be appriciated.

     

    #103596

    Welcome to the forums. I will move your topic to the ProOrder forum as that is the correct place for it as it is an automated strategy question and not a platform issue. Please try to post in the correct forum with future topics.

    Try the following to record the highest high since the last trade closed:

     

    #103606

    I have tried above code but it doesn’t return correct result.

    e.g. if First order (sell) executed on 1100 than I want to executed 2nd order only if market went to more than 50 points up (means reach above 1150) and come down to below 1100.

    #103612

    Sorry – I didn’t realise that you wanted someone to write the whole thing rather than just fix the bit of code that you posted!

    You could try something like this:

     

    #103613

    >> Please update your country flag in your profile. Thank you 🙂 <<

     

    1 user thanked author for this post.
    #103639

    Thanks for help

    I had no intension that someone write code for me.

    I already written my code but I am getting wrong result into lowest and highest all the time. I will try above logic and let you know about result.

    #103640

    I have tried above code but still not getting accurate result. Find my below code which is executing every second.

    First Buy and Sell is giving me reference point for future trade.

    3rd block should execute only when market went to more than 50 points up (in compare to lastprice) and come down back to lower than lastprice.

    I have spent so much time but cannot figure out why every sell order execute on every single second. it is simple program but giving so much pain, might be because I am new on this platform.

    #103644

    Your code is very confused and so it is difficult to work out what you are trying to actually do. You have a BUY and and a SELL and a couple of SELLSHORT’s but no EXITSHORT.

    In your code absolutely everything is enclosed in the following condition so if this is not true then nothing happens:

    I would suggest that you explain clearly what you are trying to do with all entry and exit conditions clearly explained and then it might be easier for someone to code something for you.

    The code I provided does what you requested in post #103606 so either you explained it wrong or you want something completely different! 🙂

    #103650

    I have simplified my code and added more description.

    #103657

    So it seems that for some reason you want to just buy the first bar after the strategy is started and sell it immediately just to get the start price? Why not just store the first bars close as the start price rather than actually trade and definitely lose the spread in one second?

    Then you want to see if price rises 50 points higher than that price and then drops below it. At this point you want to short with a position size of 10.

    This new purchase price becomes your new price to use for comparison once this trade is finished. You have no exit conditions or take profit/stop loss levels so I assume there is more code that we cannot see?

    If my interpretation is correct then this should do it although it is impossible to test due to the lack of exit conditions:

     

    #103663

    Obviously get rid of line 1 if you actually want to accumulate positions. I also forgot that your code version will only place a maximum of eight trades before it stops trading forever.

    To get the same thing try this:

     

    1 user thanked author for this post.
Viewing 11 posts - 1 through 11 (of 11 total)

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