Placing order at certain time of the day

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17909 quote
    kg6450
    Participant
    Average

    Hi all, I’m a complete beginner to coding with ProRealTime and I’d appreciate it if anyone could help me out.

     

    What I’m trying to do is code a system where I enter the market at 12pm everyday and bet against the trend since midnight that same day.

    So for example the system would start at midnight then check the price at 12pm (midday). If the market has gone down, it would buy. If the market has gone up, then it would sell.

    I know of course that this isn’t the most profitable system but it’s more for me to get to grips with the actual coding rather than making any profit at the moment.

    If anyone could help me out I’d really appreciate it, thanks!

    #17928 quote
    Wing
    Participant
    Veteran
    if time=120000 then
    if dclose(1)>close then
    buy 1 lot at market
    endif
    if dclose(1)<close then
    sellshort 1 lot ar market
    endif
    endif
    

    Does that work?

    Nicolas thanked this post
    #18114 quote
    kg6450
    Participant
    Average

    That works, thank you very much, its so much simpler than I thought!

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

Placing order at certain time of the day


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
kg6450 @kg6450 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by kg6450
9 years, 2 months ago.

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