Short in S&P with Supertrend on thurstday

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #232728 quote
    LamboLambo
    Participant
    New

    Hello!

    I have a Problem with my programm.

    The Idea is to go short on thursday on S&P if the close on wednesday is under the Supertrend (2,5 10).

    Exit is at the end of the month. Entry at beginn of month. SL is if the course makes a new 20 day high.

    The code works as estimated,

    but i saw a detail that if the open on thursday is higher than the supertrend level from wednesday, there shouldn’t be a short trade.

    On September 5.9.19 the open is higher than the supertrend level of wednesday 4.9.

    In this case i don’t want to do the trade because it close is.

    Can someone help me with my code?

    defparam preloadbars=5000
    defparam cumulateorders=false
    size=(100000+strategyprofit)/(close)
    
    // Festlegung Variablen
    
    
    //Supertrendabfrage für Short
    indicator7 = SuperTrend[2.5,10]
    c7 = (close < indicator7)
    
    
    
    c9 = dayofweek=4 //Wochentag Thursday
    
    //Short Exit over 20 dayhigh
    indicator10=DonchianChannelUp[20]
    c10=close>indicator10
    
    
    //Entry parameter
    
    
    
    
    if not longonmarket and day>3 and day <24 and c7 and c9 then // short-parameter
    sellshort size contracts roundedup at market
    endif
    
    if shortonmarket and day>24 or c10 then // parameter for short-close
    exitshort at market
    endif
    Problem_Supertrend.png Problem_Supertrend.png
    #232758 quote
    Iván GonzálezIván González
    Moderator
    Legend

    Hi!

    You could change the entry condition with a stop order.

    sellshort size contracts roundedup at SuperTrend[2.5,10] stop

    In this case, if the price on Thursday is higher than Supertrend you will not have a trade.

    Lambo thanked this post
    #232760 quote
    robertogozzirobertogozzi
    Moderator
    Legend

    CLOSE, that day, was UNDER th eSuperTrend.

    Lambo thanked this post
    x-4.jpg x-4.jpg
    #232954 quote
    LamboLambo
    Participant
    New

    Yes Roberto you are right, but the entry start on 15:30. An on this time we stay over the super trend Level from day before. So I don’t want to entry this trade. I only want to do the trade if the open ist lower then supertrend the day before.

    Can you help me?

    #232955 quote
    LamboLambo
    Participant
    New

    Thanks. That is only a solution if the course is on open higher than the supertrend. All other cases i cant do the trade

    I test

    c8= open[1]<indicator7

    and add this to the sell order, but it didn’T work. It still sell

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

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Short in S&P with Supertrend on thurstday


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Lambo @lambo Participant
Summary

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

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/16/2024
Status: Active
Attachments: 2 files
ProRealCode ProRealCode
Loading...