NexusFi: Find Your Edge


Home Menu

 





Restricting number of long/short trades on multicharts?


Discussion in EasyLanguage Programming

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




 
Search this Thread

Restricting number of long/short trades on multicharts?

  #1 (permalink)
Fudgester
Mumbai + India
 
Posts: 8 since Aug 2020
Thanks Given: 2
Thanks Received: 0

Hey guys,

I was wondering if there are any keywords in multicharts to restrict the number of long trades and short trades taken in a day to 1?

I tried using maxtrades, but it just limits all the trades. So on a day if long has been triggered twice, then we end up taking them and ignoring the upcoming short trades.


Anyone?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Quantum physics & Trading dynamics
The Elite Circle
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Strategy stop orders partially filled
EasyLanguage Programming
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
22 thanks
What is Markets Chat (markets.chat) real-time trading ro …
19 thanks
ApexTraderFunding.com experience and review
15 thanks
GFIs1 1 DAX trade per day journal
12 thanks
EG Indicators
11 thanks
  #2 (permalink)
Kolnidrei
Lyon/France
 
Posts: 23 since Aug 2012
Thanks Given: 1
Thanks Received: 14

I'm afraid you can't achieve this with a simple keyword
but you will need to apply a code similar to this one :

 
Code
Inputs:
Longs(1),
Shorts(1);
Vars:
MP(0),LongsCounter(0),ShortsCounter(0),Longsignal(false),Shortsignal(false);

MP = Marketposition;
if Date <> Date[1] then begin
LongsCounter = 0;
ShortsCounter = 0;
end;
If MP = 1 and MP[1] <> MP then LongsCounter = LongsCounter + 1;
If MP = -1 and MP[1] <> MP then ShortsCounter = ShortsCounter + 1;
Longsignal = O > H[1];
Shortsignal = O < L[1];
If Longsignal and LongsCounter < Longs then buy next bar at market;
If Shortsignal and ShortsCounter < Shorts then short next bar at market;

Reply With Quote
Thanked by:
  #3 (permalink)
Fudgester
Mumbai + India
 
Posts: 8 since Aug 2020
Thanks Given: 2
Thanks Received: 0



Kolnidrei View Post
I'm afraid you can't achieve this with a simple keyword
but you will need to apply a code similar to this one :

 
Code
Inputs:
Longs(1),
Shorts(1);
Vars:
MP(0),LongsCounter(0),ShortsCounter(0),Longsignal(false),Shortsignal(false);

MP = Marketposition;
if Date <> Date[1] then begin
LongsCounter = 0;
ShortsCounter = 0;
end;
If MP = 1 and MP[1] <> MP then LongsCounter = LongsCounter + 1;
If MP = -1 and MP[1] <> MP then ShortsCounter = ShortsCounter + 1;
Longsignal = O > H[1];
Shortsignal = O < L[1];
If Longsignal and LongsCounter < Longs then buy next bar at market;
If Shortsignal and ShortsCounter < Shorts then short next bar at market;

Thanks a ton kolnidrei. I was worried that this could not be possible as one of the limits of "easy language". Thanks a ton for the template. Ur a lifesaver

Reply With Quote




Last Updated on August 16, 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