help with look back code

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #180702 quote
    brett0604
    Participant
    New

    Hi there im totally new to this, but quite keen to learn.  What my query is if im trying to create code the will buy if the condition meets closing candle must close above the previous swing high how to i write this line. would be grateful if anyone can help thanks Brett

    #180725 quote
    robertogozzi
    Moderator
    Master

    There you go:

    Once SwingPrice = 0
    Bearish = close < open
    Bullish = close > open
    SwingH  = Bearish and Bullish[1] and close[1] = highest[10](close)
    If SwingH then
       SwingPrice = close[1]
    Endif
    If SwingPrice > SwingPrice[1] then
       Buy 1 contract at market
    Endif
    brett0604 and Midlanddave thanked this post
    #181346 quote
    brett0604
    Participant
    New

    hi there im  so greatful for your coding ive just managed to take a look and im buzzin now thanks once again

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

help with look back code


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
brett0604 @brett0604 Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/31/2021
Status: Active
Attachments: No files
Logo Logo
Loading...