Fixing a price position every day at one specific hour.

Forums ProRealTime English forum ProOrder support Fixing a price position every day at one specific hour.

This topic contains 2 replies, has 2 voices, and was last updated by avatar Juan Salas 9 months ago.

View all attachments
Viewing 3 posts - 1 through 3 (of 3 total)
  • #59226

    Dear all,

    I am trying to solve a coding problem it seems easy but I get it wrong in the backtest.

    I want to take as reference everyday’s price at 090000h. Let’s call it levelZERO. I would write:

    So, that day, if I want to refer to the price at 09:00h I would mention levelZERO in the code. It seems that it has to be reset everyday, seems the lecture I got in the backtest does not make any sense. Everyday levelZERO should be different, but it seems that it refers to a price from a different day.

    I have tried:

    It does not show a lot of imagination but it is simple.

    I believe it still doesn’t work, since I don’t get the lecture I want in the backtest.

    I would appreciate if anyone can confirm with me if the above is right, or any other (and more simple way) to “lock” the price at 09:00 everyday.

    Thanks in advance,

    Juan

    #59549

    Your first code example should work. Anytime you think your code is wrong or something dis-functioning, try to debug it with GRAPH or build a simple indicator from it and apply it on your chart.

    090000 is a time that must be read by the code, if you launch the code on daily basis, then it is possible that it will not be updated, since the code is read one time at Close and at that moment, time could not be 09h00m00s.

     

    1 user thanked author for this post.
    #59564

    Nicolas,

    Thanks. That is what I did. I built a simple indicator representing levelZRO and it works. I am discovering GRAPH applications to debug/confirm and to graphically see the results of same lines of codes.

    Thanks again.

    Juan

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

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