NexusFi: Find Your Edge


Home Menu

 





How to create a delay for a few days after negative trade?


Discussion in EasyLanguage Programming

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




 
Search this Thread

How to create a delay for a few days after negative trade?

  #1 (permalink)
MasterYan
San Francisco, CA
 
Posts: 30 since Jul 2016
Thanks Given: 13
Thanks Received: 4

I'm just starting to code on EasyLanguage and I can't figure out how to write code like this:

If the last trade was negative then don't do any trades for 5 days (or for 50 bars).

?

Reply With Quote

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

  #2 (permalink)
 
ShadowFox's Avatar
 ShadowFox 
CO/USA
 
Experience: Intermediate
Platform: TradeStation, Multicharts
Trading: Stocks, Futures
Posts: 129 since Jun 2020
Thanks Given: 70
Thanks Received: 157

Might be able to use the NetProfit call. I haven't done this to reduce trading but I have used it for scaling and compounding within a strategy. There is also OpenPositionProfit. The NetProfit does not include current position until it's closed I am pretty sure.

Possibly something like an if statement with NetProfit < NetProfit[1] to then set a bartimer. Could call currentbar + 5 then set entry parameters on that. Or just a countdown.

I really don't recommend this though. From my experience, my best trades are typically just after my worst trades. It would be better to find out why those market conditions might be bad to trade for a few days and limit through an indicator. Let the market tell you when to trade rather than an arbitrary timer.

If you cannot identify then you cannot filter it and that's okay. Edges don't tell you when a trade is going to work. Edges only tell you that you should be profitable over a larger set of trades. The key is to trade every single one though, unless you have data to suggest you shouldn't.

Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 Anka Software   is a Vendor
 
Posts: 19 since Jan 2013
Thanks Given: 0
Thanks Received: 9


PositionProfit <- will give the last position profit
BarsSinceEntry <- will give number of bars since entry

You can use the above two EL functions to delay the next trade.

Reply With Quote
The following user says Thank You to Anka Software for this post:





Last Updated on July 30, 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