Short Term Volatility

Forums ProRealTime English forum ProOrder support Short Term Volatility

  • This topic has 22 replies, 2 voices, and was last updated 8 years ago by avatarwolf.
Viewing 15 posts - 1 through 15 (of 23 total)
  • #13162

    Hi, Im having trouble coding a system where it will open a position after a stock has risen/fallen 1% in the last 30 minutes.

    Any help is welcome since I have been struggling to code anything that works.

    Thank you

    Jem

     

    #13172

    There is a specific instruction for Variation that you can use easily to make what you want to do.

    On a 30 minutes chart, the code would be :

     

    1 user thanked author for this post.
    #13175

    ok great thank you, but what if i wanted the last 30 minutes but on a 5 minute chart?

     

    Thanks

    #13180

    You can code it like this, make the summation of the last 6 Variation (6 x 5minutes candlesticks = 30 minutes) :

    Didn’t test it though, but it should work ok.

     

    1 user thanked author for this post.
    #13181

    Hi Nicolas,

    I’ve tested it and it seems to work but still unsure as it is the weekend, but thank you for your help.

    I would greatly appreciate it if you could breakdown the part of code listed below since I might need to adjust some conditions at a later date.

    Thanks

    Code:

    condition = summation[100](Variation(close))>=1

    IF condition THEN
    buy 1 share at market
    ENDIF

    #13182

    You want me to explain each line?

    1 user thanked author for this post.
    #13183

    no sorry just this part please ‘summation[100](Variation(close))>=1’

    #13196

    Summation calculate the sum over the last X periods (100 in this case) of the value under brackets.

    But in this statement, we test if this summation is superior or equal to 1. So if it’s true, the ‘condition’ variable is set to 1 (which is “true” in PRT language).

    1 user thanked author for this post.
    #13201

    ok thank you, so if i wanted to adjust the code to look for 2% changes instead of 1%, what part should i alter.

    #13202

    Also it doesnt seem to work with stocks that have fallen x % it only shows stocks that have gone up

    #13206

    Hi Nicolas,

    After doing some testing ive found out it works alot better in a screener format, ive only changed the code from ‘buy 1 share at market’ to ‘screener’ and ive found these issues:

    • Code doesn’t display stocks that have fallen, only risen
    • It doesn’t work alot of the time, for example to test the code, I found some examples where the stock has risen 1% or more in the last few hours of Friday’s trading day and adjusted the screener to the same amount of hours and the stock wont appear in the screener when it should.
    • It works well when candles our on ‘daily’ (still only stocks that have risen) but when I put it on 10 mintues or 5 minutes I have many issues.

    Any help is welcome, thank you

    #13208

    Yes this code is only for rising 1%, if you want to catch the falling stocks, just change the formula to find the ones that are <=-1% .. that’s all 🙂

    I believe you have not real time access, only EOD?

    1 user thanked author for this post.
    #13209

    Just added the falling stock code, and everything has gone crazy lol. Have I done something wrong? as it now picks stocks that havnt moved more than 1% in the last 30 mins. Ive attached a picture where you can see my code, the stock and the screener on the left.

    Thanks for your help 🙂

    Image: https://gyazo.com/925f98b99649fb9601bb6d8a7874e259

    #13215

    Ouch…what have you done? 😨
    I’ll fix this tomorrow or maybe later.
    You can also upload pictures here FYI.

    1 user thanked author for this post.
    #13216

    Clearly im good at breaking stuff haha
    Anytime before monday would be hugely appreciated.
    I saw you could but the program i use gives me a web link but ill upload the images instead from now 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