NexusFi: Find Your Edge


Home Menu

 





Strategy exit based on cumulative gain or loss


Discussion in EasyLanguage Programming

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




 
Search this Thread
  #1 (permalink)
Donovan2580
Port St. Lucie, FL
 
Posts: 36 since Jul 2016
Thanks Given: 22
Thanks Received: 37

I am looking to have my strategy “Quit for the day” once I reach a certain profit target or loss amount.

I am hoping it will take into consideration the daily total of my completed trades, as well as any current trade I am in.

Any ideas on this?? Any help would be greatly appreciated.

I am decent at easy language, but really don't know where to start.

Thanks in advance,

Donovan


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
The Ceasefire Curve: 2pct Peace by Next Week, 60pct by S …
Prediction Markets & Event Contracts
CFTC Workforce Shrinks 24% to 15-Year Low While Predicti …
Traders Hideout
Without Pulisic, USA 61.5% Live vs. Australia -- France …
Prediction Markets & Event Contracts
World Cup Opens: USA at 45.5% Tonight as Markets Push Ba …
Prediction Markets & Event Contracts
TradingView Deploys AI to Monitor SEC Filings in Real Ti …
TradingView
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
197 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #3 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642


Donovan2580,

the code in the below link might not exactly do what you have in mind, but should give you a good idea about how you could do it:



Other than that you can likely find other examples here on nexusfi.com using the search function or on the official TS forum.

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

Donovan2580,

one idea that might work for you would include storing the net profit of your strategy on a date change in a variable and then comparing the current net profit against this variable.
Once the different is greater than your target, set a boolean flag to true and use this flag's value to exit any open positions and also to prevent new entries from being taken. Just keep in mind to set the boolean flag to false on a date change, too - otherwise your strategy wouldn't trade anymore after a profit exit.

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:
  #5 (permalink)
Donovan2580
Port St. Lucie, FL
 
Posts: 36 since Jul 2016
Thanks Given: 22
Thanks Received: 37

Just wanted to say thank you... The Boolean is maybe a bit over my head, but it gives me something to look into.

Thanks much for taking the time to reply


Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,642

Donovan2580,

you are welcome. A boolean variable simply means that this variable is of the type bool and holds true or false as values ( BOOL (Reserved Word))

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:




Last Updated on July 27, 2017


© 2026 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 - Downloads - Top
no new posts