NexusFi: Find Your Edge


Home Menu

 





EasyLanguage Daily Profit and Daily Loss limit in strategy


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one ABCTG with 6 posts (4 thanks)
    2. looks_two 20YRTRADER with 3 posts (0 thanks)
    3. looks_3 AlexBa with 3 posts (0 thanks)
    4. looks_4 djplastic with 2 posts (0 thanks)
      Best Posters
    1. looks_one Big Mike with 20 thanks per post
    2. looks_two Ranger with 6 thanks per post
    3. looks_3 insideday with 3 thanks per post
    4. looks_4 ABCTG with 0.7 thanks per post
    1. trending_up 32,505 views
    2. thumb_up 36 thanks given
    3. group 17 followers
    1. forum 25 posts
    2. attach_file 1 attachments




 
Search this Thread

EasyLanguage Daily Profit and Daily Loss limit in strategy

  #21 (permalink)
AlexBa
Santo domingo/ Dominican Republic
 
Posts: 5 since Oct 2019
Thanks Given: 2
Thanks Received: 0

Hello ABCTG

I want to see a indicator show me by a line the Current day P/L, so when the P/L take the max profit limit or take the max loss limit, this can be with a green line when the P/L is between the max profit and max loss, else with a red line.

Regards




ABCTG View Post
AlexBa,

what exactly do you want the indicator to display? Strategy related reserved words won't be available in indicators, but TS offers reserved words that make some strategy related values available in indicators like I_closedequity
for example and you can use this to replace Netprofit in the indicator code. You will however still need a strategy applied to the same chart in order for I_closedequity to return a value different than 0.

Regards,

ABCTG


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Request for MACD with option to use different MAs for fa …
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
67 thanks
NexusFi site changelog and issues/problem reporting
48 thanks
Battlestations: Show us your trading desks!
43 thanks
GFIs1 1 DAX trade per day journal
32 thanks
What percentage per day is possible? [Poll]
31 thanks

  #22 (permalink)
 20YRTRADER 
Atlanta, GA/USA
 
Experience: Advanced
Platform: Ninja Trader & TradeStation
Broker: TradeStation
Trading: Crude Oil, Dow
Posts: 7 since Sep 2015
Thanks Given: 2
Thanks Received: 0

Mike - Is this code applicable to one strategy or all 2+ open at that time? If I have 2 workspaces open and I have a profit in one workspace of $200 and $300 in another, will it close down both charts at market at a $500 target? Thanks.

John

PS - I am not sure if your old post from 2010 is linked.

Reply With Quote
  #23 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623


John,

the information the reserved word's from the code @Big Mike posted provide are chart specific only.

Regards,

ABCTG


20YRTRADER View Post
Mike - Is this code applicable to one strategy or all 2+ open at that time? If I have 2 workspaces open and I have a profit in one workspace of $200 and $300 in another, will it close down both charts at market at a $500 target? Thanks.

John

PS - I am not sure if your old post from 2010 is linked.


Follow me on Twitter Reply With Quote
The following user says Thank You to ABCTG for this post:
  #24 (permalink)
Donovan2580
Port St. Lucie, FL
 
Posts: 36 since Jul 2016
Thanks Given: 22
Thanks Received: 36

Thank you for all the info in this thread. I was wondering if anyone has a "stand alone" strategy that will work with tradestation?

I am running a strategy on renko charts with limits (Which everything works fine) but can get a little hairy.

My stand-alone profit targets and stop limits work perfectly so I was hoping to just tack on a separate strategy for max daily profit loss.

Any ideas would be greatly appreciated.

Thanks in advance

Donovan

Reply With Quote
The following user says Thank You to Donovan2580 for this post:
  #25 (permalink)
Vientomarsol
Port St. Lucie, FL.
 
Posts: 25 since May 2016
Thanks Given: 17
Thanks Received: 9

Hi Donovan 2580,

I'm trying to do exactly the same thing you are, and found a clue that maybe someone here might be able to resolve.

I’m trading Russell Futures (RTY) in Tradestation. I wish to build a Stand-Alone strategy for Daily Profit/Loss Limit. Strategy needs to reference my Beginning-of-Day Account Balance while I’m in a trade; and exit the trade when / if my [user defined] Daily Profit or Loss target is achieved. It would also prohibit any further trades that day, after Profit or Loss target has been achieved.
My 2017 EasyLanguage Essentials Programmers Guide states the following:
• “EasyLanguage allows you to access brokerage account information within your strategies so you can more accurately tie your account money management to your real-time strategy trading.”
and
• “TradeManager reserved words allow you to access fields from the TradeManager’s Balance and Positions tabs. There are specific reserved words for both your equity and futures accounts.”
Further down the page I find reserved words and specific discussion of my strategy goals:
• GetBDAccountNetWorth retrieves the beginning Day Account Net Worth amount from the TradeManager’s Balances tab for the given equity/stock account. Zero will be returned for a futures account or an invalid account.
• GetRTAccountNetWorth retrieves the real-time Account Net Worth amount from the TradeManager’s Balances tab for the given equity account. Zero will be returned for a futures account or an invalid account.
Usage Example (TradeManager account balances):
Vars: NetProf(0);
NetProf = GetRTAccountNetWorth – GetBDAccountNetWorth;
In this example, we can calculate the real-time net profit for an account.
The above ‘Usage example’ is exactly what I want to do (I think), but Zero will be returned for a futures account or an invalid account. What am I supposed to make of that?
Any suggestions for this as a Futures Account strategy?

Reply With Quote
The following user says Thank You to Vientomarsol for this post:
  #26 (permalink)
tradeswimmer
Hartford CT
 
Posts: 3 since Feb 2021
Thanks Given: 2
Thanks Received: 1

Vientomarsol & Donovan 2580,

I am in a similar situation with the same questions. I am going by trial and error now and will post if I have good results. Please update the same if you guys learn more.

-Tradeswimmer

Reply With Quote





Last Updated on March 11, 2021


© 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