NexusFi: Find Your Edge


Home Menu

 





Daily Loss Limit


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one togier with 4 posts (1 thanks)
    2. looks_two crazybears with 2 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 redratsal with 1 posts (4 thanks)
    1. trending_up 12,169 views
    2. thumb_up 9 thanks given
    3. group 9 followers
    1. forum 11 posts
    2. attach_file 0 attachments




 
Search this Thread

Daily Loss Limit

  #11 (permalink)
 
JonnyBoy's Avatar
 JonnyBoy 
Montreal, Quebec
 
Experience: Advanced
Platform: NinjaTrader 8
Broker: Kinetick
Trading: ES
Posts: 1,561 since Apr 2012
Thanks Given: 706
Thanks Received: 3,858


GeeBee View Post
Is there any indicator for Daily Loss and Profit limit. I don't know how to make one. Thanks

Yes. It is called your butt, which you use to sit on your hands.

I am not sure what you mean by 'indicator'. To do what? Stop you from trading once your reach a predefined profit or loss?

--------------------------------------------------------
- Trade what you see. Invest in what you believe -
--------------------------------------------------------
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
24 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #12 (permalink)
 George P 
Ath. Gr.
 
Experience: Intermediate
Platform: NinjaTrader
Trading: ES, 6E
Posts: 40 since Nov 2016


drolles View Post
Would a solution be to search the trade collection for trades that occurred that day, then add the current PnL?

 
Code
if (dailyPnL > -(maxLoss))
                    {

                        if (Performance.AllTrades.Count != tradeCount)
                        {
                            tradeCount = Performance.AllTrades.Count;

                            foreach (Trade x in Performance.AllTrades)
                            {
                                if (x.Exit.Time.Date.CompareTo(Time[0].Date) == 0)
                                {
                                    dailyPnL += x.ProfitCurrency;

                                }

                            }

                        }

                        if (Position.MarketPosition != MarketPosition.Flat)
                        {

                            dailyPnL += Position.GetProfitLoss(Close[0], PerformanceUnit.Currency);

                        }

                    }
You would obviously need to reset the dailyPnL each day.

 
Code
if (Bars.FirstBarOfSession && FirstTickOfBar)
                    {

                        dailyPnL = 0;}
It when then work regardless if you are in backtest or live trading. You would always be searching the trade collection based on the current day. Of course, please feel to poke holes in my logic

This is smart ! Thanks.

Reply With Quote




Last Updated on February 4, 2017


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts