Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

Search the Community

Showing results for tags 'daily net profit'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to Traders Laboratory
    • Beginners Forum
    • General Trading
    • Traders Log
    • General Discussion
    • Announcements and Support
  • The Markets
    • Market News & Analysis
    • E-mini Futures
    • Forex
    • Futures
    • Stocks
    • Options
    • Spread Betting & CFDs
  • Technical Topics
    • Technical Analysis
    • Automated Trading
    • Coding Forum
    • Swing Trading and Position Trading
    • Market Profile
    • The Wyckoff Forum
    • Volume Spread Analysis
    • The Candlestick Corner
    • Market Internals
    • Day Trading and Scalping
    • Risk & Money Management
    • Trading Psychology
  • Trading Resources
    • Trading Indicators
    • Brokers and Data Feeds
    • Trading Products and Services
    • Tools of the Trade
    • The Marketplace
    • Commercial Content
    • Listings and Reviews
    • Trading Dictionary
    • Trading Articles

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


First Name


Last Name


Phone


City


Country


Gender


Occupation


Biography


Interests


LinkedIn


How did you find out about TradersLaboratory?


Vendor


Favorite Markets


Trading Years


Trading Platform


Broker

Found 1 result

  1. While working up an auto execution strategy for the futures market, my friend and I created this segment of code that provides for market exit after achieving the desired profit target or end of time. Hope others find it useful ..... RANGER ///// This code ends trading once the Daily Net Points are achieved or end time constraint is met. //// Designed for use on futures contracts /// If used within an Auto Execution Strategy, you may elect to revisit the "marketposition" terms. //// Co-written by ZAC & RANGER 2010 Rev 0 / tested and found operational inputs: DailyNetPoints(4), StopLossTicks(12), ProfitTargetTicks(12), BreakEvenTicks (6), NumberContracts(4), start_time(0930), end_time(1615), ExitOnClose( true ); variables: Prior_Date(date), Prior_Net_Profit(0), StopPx_Amt(0), Daily_NP_Amt(0), Profit_Target_Amt(0), Break_Even_Amt(0); StopPx_Amt = ((StopLossTicks/4)*BigPointValue) * NumberContracts; Daily_NP_Amt = (DailyNetPoints * BigPointValue) * NumberContracts; Profit_Target_Amt = ((ProfitTargetTicks/4)*BigPointValue) * NumberContracts; Break_Even_Amt = ((BreakEvenTicks/4)*BigPointValue) * NumberContracts; once begin Prior_Date = Date - 1; end; if Time > start_time and Time < end_time then BEGIN if Date > Prior_Date then begin Prior_Date = Date; Prior_Net_Profit = netprofit; end; if netprofit - Prior_Net_Profit <= Daily_NP_Amt then begin ///////////START ENTRY/EXIT SIGNALS HERE ///////////////END ENTRY EXIT SIGNALS HERE end else {ends when daily profit objective is reached} begin if marketposition = 1 then sell ("DONE-2") next bar on Open; if marketposition = -1 then buytocover ("DONE-1") next bar on Open; end; END else if Time > end_time then {ends when time limit is hit} begin if marketposition = 1 then sell ("EOD-0") this bar on Close; if marketposition = -1 then buytocover ("EOD-1") this bar on Close; end; if ExitOnClose = true then SetExitOnClose ; {exit on close of market - this can be rem if desired} if marketposition <> 0 then begin SetDollarTrailing( StopPx_Amt ) ; SetBreakeven( Break_Even_Amt ) ; if Profit_Target_Amt > 0 then SetProfitTarget(Profit_Target_Amt ) ; end;
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.