Script stops buying in high volume or sudden movements

Forums ProRealTime English forum ProOrder support Script stops buying in high volume or sudden movements

Viewing 15 posts - 1 through 15 (of 23 total)
  • #107219

    Hi,

    I need urgent help on this. My scripts start stopping during high volume in a market or sudden up & down movements.

    I run this script with a time interval of 1 min. Every time there is a high volume the script stops buying or selling. It does not stop it just does not open a new position. I have run in the test environment with different time intervals and also these scripts stop at a high volume, like with an opening of a trading window.

    Thanks for your help

     

    Greeting, Hubert Simonis

     

     

     

    #107324

    I can’t see any reference to VOLUME, is there any missing code?

    #107336

    Hi Robert,

    Thanks for your reply.

    There is no volume statement in the script. The uploaded script is the whole script.

    During a high volume it looks like orders get cancelled and no new order is created.

    The script continues to run but without any others in the market.

    Due to this I have no order when there is a nice rally.

    Please let me know any advise.

    #107338

    Line 36 misses parenthesis for a correct test of any of the conditions.

    #107342

    For Forex pairs IG does not return volumes, at present.

    Your calculations of your position size seems to be incorrect, yielding over 737 contracts!

    If you add these line at the end of your code:

    you’ll be able to GRAPH all variables needed to debug your code to be able to detect errors, by watching the VARIABLES’ window in ProBackTest.

    The problem is not in spikes, but in some of your calculations.

     

     

     

    #107347

    Hi Robert and Nicolas,

    Big thank you for the tips (still learning how to code 🙂

    I am running the script on Russell 2000 and in this case the number of contract calculation is correct (0.53 contracts).

    The results of the script are quite good I would say.

    % Winning Trades            70%

    Gain / Loss                          1.17

    Time interval 1 min

    I would be surprised it the error is just the misses parenthesis but I have updated the script and run it in demo, so lets see what happens when Russell 2000 opens today (15:30 local time Netherlands).

    Yesterday evening I created a simple version of the script to see if that runs better.

    Would this script be ok ? Any tips ?

    Greetings Hubert

     

     

    #107360

    Hi,

    Update after the Russell 2000 trading window opening of today ; only the scripts that used the 5 sec timeframe survived the first few hours. Rest stopped opening orders.

    I am fine with the 5 sec interval but i am still wondering how this is possible, any thoughts ?

    I am updated my code in the following way.

    Any tips are highly appreciated. Many thanks

     

    #107364

    Line 3 is useless, just run it from a 5-second TF, since you are not using multiple TF’s.

    #107367

    ProOrder needs 1 bar to update the (Long/Short)OnMarket status, so when a trade opens and closes on the same bar your conditions are impossible to be verified.

    #107377

     

    Thanks!

    How could i resolve this ?

    check if the trade is in same bar ? Barindex = tradeindex ?

    #107387

    Check not be OnMarket now and not to have been the previous bar, still STRATEGYPROFIT is different because a trade opened and closed on the same bar:

     

    #107390

    thanks, this helps for the performance of the last trade but I can’t define if this trade was long or short.

    Any suggestion ?

    Thanks, Hubert

    #107432

    Hi Robert,

    I worked till late on my script and finally I found it out.

    The system doesn’t get stuck anymore and the back test results are very good (last 2 weeks) but also in the very bear week of 26 August.

     

    #107438

    With orders AT MARKET it’s easy, if you place a BUY order then you know it’s a LONG trade, if it’s a SELLSHORT then you place a SHORT order.

    If it’s a pending order you can reference STRATEGYPROFIT to tell whether it was a winning or losing strategy, then check the prior two TRADEPRICE to tell if it was a Long or a Short trade.

     

    #107447

    How are you getting any results? It runs out of money and quits almost immediately. If I remove the QUIT then I can see that it just sucks the account dry.

    I tested with 0.3 spread and tick by tick on.

     

Viewing 15 posts - 1 through 15 (of 23 total)

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