NexusFi: Find Your Edge


Home Menu

 





rotational trading


Discussion in Platforms and Indicators

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




 
Search this Thread

rotational trading

  #1 (permalink)
xxx11
Stuttgart
 
Posts: 9 since Oct 2016
Thanks Given: 0
Thanks Received: 0

Hi,
I wrote an algorithm which says that I would like the 5 best stocks each month and sell them in the same month. I choose the 5 best stocks according to the performance.
What I would like to do now:
I would like to have in total 50000 equity capital. But for each stock 10000.
That means that I would like to buy every month 5 stocks with an equity capital of 10000 per stock. Next month when I buy it I would like to have the same.
Right now, the capital is accumulating. But I do not want that my algorithm accumulates.
The other thing is that I would like to say: If for example AAPL is in january under the 5 best ones and in february as well. I don't want to buy it again and the equity capital in total is 40000.
Is there anyone who could help me with this?



SetPositionSize(50000,spsValue);
PosQty = Param( "Number of Positions", 5, 1, 20, 1); // name, MaxOpenPositions, MinShares,
SetOption( "InitialEquity", 50000 );
SetPositionSize(20,spsPercentOfEquity);
SetPositionSize(PosQty,spsNoChange);
SetOption( "MaxOpenLong", PosQty );
SetOption( "MaxOpenPositions", PosQty );
SetOption( "WorstRankHeld", PosQty );
SetOption( "AllowPositionShrinking", True );
Edit/Delete Message

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Cheap historycal L1 data for stocks
Stocks and ETFs
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
 
  #2 (permalink)
 prouser 
Zurich/Switzerland
 
Posts: 79 since Oct 2014

 
Code
ieq = 50000;

SetOption( "InitialEquity", ieq );

SetPositionSize( ieq / 5, spsValue );

Reply With Quote




Last Updated on October 26, 2016


© 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