How to code for previous days?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #17095 quote
    cusack
    Participant
    New

    Hi All

    Can someone please help with what I think is a simple code?  I’m not a coder so am fumbling around getting nowhere.

    Basically I want to place a sell order if the following occurs….

    IF  RSI is over 70
    AND RSI for the current day -1 is under 70
    AND RSI for the current day -2 is under 70
    AND RSI for the current day -3 is under 70
    AND RSI for the current day -4 is under 70
    AND RSI for the current day -5 is under 70

    Thanks

    #17098 quote
    GraHal
    Participant
    Master

    Hi Cusack

    Using a Daily Timeframe Chart …

    If RSI(14) > 70 AND RSI(14)[1] < 70 AND RSI(14)[2] < 70 AND RSI(14)[3] < 70 AND RSI(14)[4] < 70 AND RSI(14)[5] < 70 THEN
    
    Buy 1 Contract at Market
    
    ENDIF

    I’m terrible at remembering syntax so watch out for syntax errors in above but PRT should alert you anyway when you try to run it.

    Cheers

    GraHal

    Nicolas and cusack thanked this post
    #17163 quote
    cusack
    Participant
    New

    You rock GraHal!  thank you!

    #17175 quote
    GraHal
    Participant
    Master

    Not really but thanks anyway! ha 🙂

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

How to code for previous days?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
cusack @cusack Participant
Summary

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

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