• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

shadow strategy

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

    shadow strategy

    i did some testing on a spreadsheet. i put a profit curve with 10 day moving average. If i skip trades where the profit curve drips below the moving average, and only trade if it profit curve is above the moving average, i can optimize it better.
    see screenshots below.
    Now how can i do this in ninjatrader. I want to run all trades in a/c A.
    I also want to execute them in a/c B. but i want to skip trades in a/c B if they drip below a certain moving average.
    How can i do it?


    #2
    Hello Junkone,

    Thank you for your note.

    You could write logic into the strategy which tracks the profit, then determine before each trade if you are above that figure before taking a trade.

    I have attached an example which will buy a certain amount of shares based on account value, which is tracked by the strategy itself. Instead of a variable of type double for the account value, you could create an array of type double and enter into that array the value of the account. Then take the SMA of the array to determine the 10 day SMA.

    See,
    https://docs.microsoft.com/en-us/dot...nsional-arrays
    https://ninjatrader.com/support/help...simple_sma.htm

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by GARZONJ, Yesterday, 11:22 PM
    0 responses
    1 view
    0 likes
    Last Post GARZONJ
    by GARZONJ
     
    Started by GARZONJ, Yesterday, 09:41 PM
    0 responses
    1 view
    0 likes
    Last Post GARZONJ
    by GARZONJ
     
    Started by mike09, Yesterday, 07:37 PM
    0 responses
    9 views
    0 likes
    Last Post mike09
    by mike09
     
    Started by bebbus, Yesterday, 04:03 PM
    3 responses
    10 views
    0 likes
    Last Post bebbus
    by bebbus
     
    Started by Unicorn_Catcher, Yesterday, 04:06 PM
    1 response
    8 views
    0 likes
    Last Post User1104  
    Working...
    X