Price Trends

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #64760 quote
    grimweasel47
    Participant
    Senior

    Hello,

    Is there a neat piece of code that defines trend by means of price bars making higher highs and higher lows?

    In my trend breakout system which starts at ‘x’ hour I want PRT to check that the high at this time is the highest of the recent ‘n’ bars. So for example if my breakout system starts at 0800 I want PRT to check that if trend conditions are met, that it only initiates trade if the high is the highest high of the day since midnight. I had been using the code below but I think this could be wrong.

    //set trend using highs and lows
    Trend1= highest[1](high)
    Trend2= highest[8](high)
    Trend3 = trend1-trend2
    ///
    Trend4= lowest[1](low)
    Trend5= lowest[8](low)
    Trend6 = trend4-trend5
    
    Trend3 >0
    Trend6 >-1

    Rather than use EMAs I want price to define the trend, so is there also a way of saying only trade if price (on H1 for example) is making higher swing highs and higher swing lows (and vice versa for shorts)?

    Many thanks.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

Price Trends


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 1 voice and has 0 replies.

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