Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

New strategy idea

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    New strategy idea

    So, here is the idea:

    Most people use dollar cost averaging in their 401k and have % of stocks and % of Bonds. But, they let their entire portfolio bounce around with the market.
    My idea is to lock in the upside.

    For example,

    A person puts in $1000 into their 401k every two weeks. Let say they buy the same ETF (SPY). But, they put in a trailing stop of .50 on each share.

    They buy $1000 of SPY @ $10 a share, next paycheck $1000 of SPY @ $20 and so on and so forth.

    Fast forward 8 paychecks. You buy the $1000 of SPY stock at $50 but, the market turns down and you are out of your entire position at 49.50 a share. But, if the stock returns to 49.50 you buy back again at it goes up to 56. But, the market tanks for a long time. You were out of the position at 55.50. But, new money from your paycheck is buying new shares on the way down, let say it hits $15 a share. You lose .50 a share on each batch of stock you buy on the way down. But, as the stock recovers, you buy back each batch of stock at the price you sold it on the way up! I will have to play with a few variables since stock can open up or down from the previous close. And I have to take expenses into consideration.

    How can I test this in Ninja Trader? Thxs



    #2
    Hi blittlej thanks for your post.

    If you need account data I would need to recommend you use NinjaTrader 8 as we added the Account class where you can pull values from your live account in NinjaScript. The strategy itself as far as implementation goes, this type of project would be best completed by one well versed in NinjaScript and C# programming. To test it, the best thing would be to use the Playback connection to find a data window that matches the price movement you are looking for, and test by running your strategy over this window over and over.

    Please let me know if I can assist any further.

    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by andrewtrades, Today, 04:57 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    3 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Started by josh18955, 03-25-2023, 11:16 AM
    6 responses
    436 views
    0 likes
    Last Post Delerium  
    Started by FAQtrader, Today, 03:35 PM
    0 responses
    7 views
    0 likes
    Last Post FAQtrader  
    Started by rocketman7, Today, 09:41 AM
    5 responses
    19 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X