NexusFi: Find Your Edge


Home Menu

 





GetRTAccountEquity - EasyLanguage, MultiCharts, Daily Account P&L


Discussion in MultiCharts

Updated
    1. trending_up 1,267 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments




 
Search this Thread

GetRTAccountEquity - EasyLanguage, MultiCharts, Daily Account P&L

  #1 (permalink)
bruiser
Burbank + California/ USA
 
Posts: 6 since Mar 2020
Thanks Given: 0
Thanks Received: 0

Hello,

I'm using a daily profit target / daily loss method whereby the strategy will stop trading once either threshold has been hit.

This works fine within the individual strategy, for example if I want to set it to a $300 profit target, it will take trades until it has made $300 and then it will not take any further trades until the next day. Same for the daily loss side.

However, the challenge I am running into is that I would like to set this same type of parameters on the "account" level rather than within each individual strategy. Specific reason being that I am trading more than one market, and the current code looks at each individual market that the code is active on and makes the trade or no trade decision based on the P&L for that particular market. Instead of looking to see what the "overall" profit / loss has been for the account which would include all of the active strategies running.

For example, if I wanted to set a $500 daily profit target for the account...and if I was trading 5 markets, I want to be able to have all of the trades stop for the rest of the day once a total of $500 has been made on the account (all markets active included). Doesn't matter if all the trades came from one market or two, etc. Just check to see if we have hit the overall daily goal and then determine if it can take a new trade or if its done for the day and apply to all active markets.

Looking for some help on an easylanguage coding spot where I am stuck.

I am assuming the GetRTAccountEquity would be the way to go about this and insert code into each of the markets to check before entering a trade. But, having some challenges with this part.

Here is the portion of the code that I am using which works on the individual market:

Variables:
DailyProfit (0),
DailyLoss (0),
YesterdayNet (0),
TodayNet (0),
DayPL (False);


If date <> date[1] then begin
YesterdayNet = NetProfit ;
End;

If MP = 0 Then Begin
TodayNet = NetProfit - YesterdayNet;
End;

If -DailyLoss < TodayNet And TodayNet < DailyProfit Then
DayPL = True
Else DayPL = False;

Would gratefully appreciate any help on converting this to look at the markets combined and account P&L vs each individual market traded.

Thank you in advance for your assistance.

Reply With Quote




Last Updated on March 23, 2020


© 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