Market price between 2pm and 10pm

Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #13268 quote
    gekko_80
    Participant
    New

    Hi there,

    how can i code the following indicator?

    “Yesterdays 10pm close price = YesClose”

    IF “the market reaches the closing price of yesterday 10pm between todays 2pm and 10pm” THEN RETURN 1

    ELSE RETURN 0

    ENDIF

    thank you!

    #13278 quote
    Nicolas
    Keymaster
    Master

    You need to store the Close value everyday at 10pm in a variable. Then test if the price were above and below the highest high and lowest low of today Close between 2pm and 10pm.

    If you have trouble coding it, please ask gently 🙂

    #13283 quote
    gekko_80
    Participant
    New

    Merci Nicolas!

    First of all: I was surfing through this forum and i really have to say that u r doing a great job helping everybody out! Thanks for your effort!

    Well, how can i store a special market price at a certain time in the past in a variable?

    all i know e.g. is:              “VariableXY” = Close(10)

    but that will store the close price of the 10th bar in the past….

    should i count the bars till i will reach the 10pm bar of yesterday 😉

    Cheers!

    #13308 quote
    gekko_80
    Participant
    New

    Anybody out there?

    #13310 quote
    Nicolas
    Keymaster
    Master

    Maybe or maybe not ..!

    Firstly, store your Close at 10pm:

    if time=220000 then
     xy = close
    endif

    Then, test if this price is met between the today’s high and low (from 7pm to 22pm):

    if time>=140000 and time<220000 and xy>=Dlow(0) and xy<Dhigh(0) then
     mytest = 1
    else
     mytest = 0
    endif

    and you are good.

    time-conditions-tested.png time-conditions-tested.png
    #13318 quote
    gekko_80
    Participant
    New

    Maybe or maybe not ..! – Haha…. 😉

    thank you Nicolas!

    i will try to move on from here….trying to implement my trading strategy that i am using manually into an automated one….

    sorry for my newbie questions….i started coding with PRT yesterday….

    if anybody has some mathematical / statistical questions just let me know about it….that is my metier….

    once more: Thank you Nicolas!

    #13322 quote
    gekko_80
    Participant
    New

    Why is this code not buying/selling any shares?

     

    if time = 220000 then
    c = close
    endif
    if time>=220000 and time<=140000 and close <= c-20 then
    buy 1 shares at market
    set target pprofit 20
    endif
    if time>=220000 and time<=140000 and close >= c+20 then
    sell 1 shares at market
    set target pprofit 20
    endif

    #13330 quote
    Nicolas
    Keymaster
    Master

    What is c-20 and c+20? Your problem comes from this.

    #13331 quote
    gekko_80
    Participant
    New

    well, c-20 or c+20 do mean that the current market price is +-20 over/under the market price that we have saved in our variable calles “c” for 10pm

    #13333 quote
    gekko_80
    Participant
    New

    FYI: i have solved the problem:

    This circumstance is not possible:

    if time>=220000 and time<=140000 and close….

    it has to be rewriten:

    if ((time>=220000 and time<=240000) or (time<=140000)) and close….

    #13397 quote
    gekko_80
    Participant
    New

    Hi there!

    How can i export price data to excel from PRT?

    I would like to initiate some statistical analysis with them that seem to be impossible within PRT….

    #13398 quote
    JC_Bywan
    Moderator
    Master
    #13403 quote
    Nicolas
    Keymaster
    Master

    You can also drag and drop any results list from PRT to Excel or any text editor. There are some other topics about it in forums.

    #13689 quote
    gekko_80
    Participant
    New

    Aloha!

    i am trying to upgrade teh indicator by declaring the exact hourly time frame in which the last days closed is reached (or not).

    all i need to finish the job is a time function code for the last hours LOW and HIGH, could not find it in the manual…..and hhigh and hlow are not working out actually.

    Would appreciate your help….thx

     

    TC,

     

    Gekko

    #13690 quote
    Nicolas
    Keymaster
    Master

    What is the timeframe used?

Viewing 15 posts - 1 through 15 (of 20 total)
  • You must be logged in to reply to this topic.

Market price between 2pm and 10pm


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
gekko_80 @gekko_80 Participant
Summary

This topic contains 19 replies,
has 3 voices, and was last updated by gekko_80
9 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 09/19/2016
Status: Active
Attachments: No files
Logo Logo
Loading...