Code : Basic building Blocks

Viewing 7 posts - 16 through 22 (of 22 total)
  • Author
    Posts
  • #65390 quote
    GraHal
    Participant
    Master

    If you number your paragraphs then my answers can show same numbers … might make it easier for you to follow my answers?

    Code is executed at end of each bar so only 1, 2, 5 or 10 mins will align with the Time 091000.

    I think Daily bars open at 000000 + millisecinds, but you need to to research more as I may be wrong.

    Use GRAPH Function and then run your Strategy and you should see what time Daily bar opens?

    You would need to post your code on here then we can see what issues there may be.

    This may help, look them under Help, documentation at the top of the Page …

    To go Long use Buy
    To exit Long use Sell
    To go Short use SellShort
    To exit Short use ExitShort

    #65392 quote
    Despair
    Blocked
    Master

    When a daily bar opens/closes depends on the market. You have to check individually. Especially commodities have sometimes strange trading hours. For example chicago wheat trades 01:00-18:20 london time.

    GraHal thanked this post
    #65891 quote
    PVPRO
    Participant
    Junior

    Hi GraHal

     

    I wonder if you get chance to look at my above request.

    Look forward hearing from you.

    Thanks.

    #65892 quote
    PVPRO
    Participant
    Junior

    Hi GraHal

     

    Thanks for your guidance.

    Sorry earlier I checked on first page & hence replied you. Let me check your above reply & revert to you.

    Thanks.

    #67395 quote
    PVPRO
    Participant
    Junior

    Hi

    I checked & noticed that we program execute buy or sell order during opening of bar & not closing of bar. Up course effect will be same. Since price at closing of bar & opening of next bar will be almost same. So we need to select time accordingly. Example, if we want to buy at 14.30 on 30 minutes timeframe then you need to mention time as 15.00 in the program so that order for buy will be executed during opening of 15.00 to 15.20 bar.

    Please correct me if I am wrong.

    Can I have simple code for following requirement from you expert people.

    1. Time frame any (Minutes – 10, 15, 30, Hrs – 1, 2 etc)
    2. Buy if open of intraday bar number 5 is > then close of intraday bar of previous day
    3. Sell as per stop loss or when time is 20.30

    Thanks.

    #67484 quote
    GraHal
    Participant
    Master

    My brain is not working right due to overwork / 10 hours barrowing muck away (into skips) after excavations for my daughters extension to her house, but to keep the momentum up …

    If Time = 143000 Then
    Buy 1 Contract at Market
    Endif
    1. Select TF on your Platform.
    2. If Intradaybarindex[5] > Close[1] Then
      Buy 1 Contract at Market
      Endif

      3. Define MyStop then use

      If Close = MyStop or Time = 203000 Then
      Sell at Market
      Endif

       

    #67488 quote
    GraHal
    Participant
    Master

    Ha below is rubbish as an answer to Item 2 above

    If Intradaybarindex[5] > Close[1] Then
    Buy 1 Contract at Market
    Endif

    It should be … ??

    If Intradaybarindex[5] > Day[1]Close Then
    Buy 1 Contract at Market
    Endif
Viewing 7 posts - 16 through 22 (of 22 total)
  • You must be logged in to reply to this topic.

Code : Basic building Blocks


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
PVPRO @pvpro Participant
Summary

This topic contains 21 replies,
has 3 voices, and was last updated by GraHal
7 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/01/2018
Status: Active
Attachments: 4 files
Logo Logo
Loading...