Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Would anyone be willing to help me with this strategy conversion

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

    Would anyone be willing to help me with this strategy conversion

    I am sorry to have to ask this here, but I am trying to convert this TS code to NinjaScript. It is very simple and only has a few lines. I have tried contacting a few NS consultants but not much luck yet.

    If anyone could help me, I would be most gracious. There are only a few lines of code. I would be willing to pay a small stipend of say $50 assuming it works. I could pay you thru paypal or some other means if you accept credit cards.



    input: numtrades (1), StopTicks (21);
    inputs: addcontractamt (20000);

    var: CurrentCapital(0), Amt(0);

    CurrentCapital = GetBDAccountEquity(GetAccountID);
    Amt = IntPortion ( CurrentCapital / AddContractAmt );
    If amt > 150 then amt = 150;
    If CurrentCapital < 2000 then amt = 1;
    //amt=1;

    Condition1 = Dayofweek(date) < 5;

    If Condition1 and entriestoday (date) < numtrades and Open > CloseD(1) then

    buy ("NEMO Long")amt contracts this bar;

    If Condition1 and entriestoday (date) < numtrades and open < CloseD(1) then
    sellshort ("NEMO Short" ) amt contracts this bar;


    setstopcontract;
    setexitonclose;
    setstoploss( StopTicks * MinMove / PriceScale * BigPointValue );
    Last edited by remorris; 11-21-2008, 11:44 AM.

    #2
    Hi remorris,

    I hope you find any takers then...

    Meanwhile you can take a look at our tutorials for indicators and strategies in NinjaScript. They give you a great start in concepts and procedures to convert code on your own.

    For indicator tutorials -



    For strategy tutorials -



    Great weekend!
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Shoot me a private message and I will send you to my programmer, he is very reasonable and He just converted several systems for me from TS to NT..

      thanks

      Metal Trader

      Comment


        #4
        Thanks Bertrand. I am a recent easylanguage convert. I am working on learning Ninjascript and C++ but I am having difficulty with using the wizard to duplicate the strategy. I will keep working on it.

        I don't think NT 6.5 has the ability to get my beginning day account equity. I use the addcontract amt to divide into this to come up with my sizing.

        I can't understand how to get the close of previous session so I can compare it to the open of the following session.

        Also, I can not figure out how to setexitonclose through the wizard/editor or limit the number of trades per day to an input. I am sure it can be done through the coding, just was hoping not to take weeks to get this strategy into place.

        I am currently using the email interface to trade it, but the slippage is fairly unmanageable. I will work on it as best I can.
        Last edited by remorris; 11-21-2008, 04:23 PM.

        Comment


          #5
          WHo is your broker? and how bad is the slippage?

          C# is much better language than Easy Language, we had to jump through hoops to get EL to do what you can do in C# with 1 line of code.. I cannot compose code but I can read it well and modify it, once you have a complete system in Ninja Script you will be able to pick it up, I would love to be able to program but if I could I don't think I would be able to trade as well..

          Comment


            #6
            I don't think it is the fills at the broker, I am filling the emailed TS signals with market orders through NT. I usually enter trades when the market is moving and the short time lag and market orders are creating the slippage as best I can tell.

            I don't want to rely on the email interface and I would like to get out of TS altogether eventually.

            My broker is Global Futures/ RCG. Data is thru PATSystem for this account. I use them because they have $500 day margin on ES. TS had eliminated their day margins, but brought them back and now about $3100 to trade an index contract.

            Originally posted by metal trader View Post
            WHo is your broker? and how bad is the slippage?

            C# is much better language than Easy Language, we had to jump through hoops to get EL to do what you can do in C# with 1 line of code.. I cannot compose code but I can read it well and modify it, once you have a complete system in Ninja Script you will be able to pick it up, I would love to be able to program but if I could I don't think I would be able to trade as well..
            Last edited by remorris; 11-21-2008, 04:54 PM.

            Comment


              #7
              Hi remorris,

              1. Correct, currently the Account Equity is not accessible in NinjaScript, but it will be in NinjaTrader 7, see this thread here - http://www.ninjatrader-support2.com/...ead.php?t=9053

              2. You can access the prior day's close with the PriorDayOHLC command, please also see this link http://www.ninjatrader-support.com/H...orDayOHLC.html

              You could do something like this:

              Code:
              [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] yestClose = PriorDayOHLC().PriorClose[[/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]]; 
              Print([/SIZE][/SIZE][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000][SIZE=2][COLOR=#800000]"The prior session close value is "[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] + yestClose.ToString());[/SIZE][/SIZE]
              [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][FONT=Verdana][/FONT][/SIZE][/FONT][/SIZE][/FONT]


              3. You can use ExitOnClose = True and also specify how many seconds before the exchange close it will flatten your positions, please see this link here - http://www.ninjatrader-support.com/H...itOnClose.html

              4. You can use the Performance object to access the trades data of your strategy, see here - http://www.ninjatrader-support.com/H...rformance.html

              5. Please make sure your AntiVirus / Security software is stripped down to a minimum to reduce your execution lag when using the TradeStation email interface, email filtering can have a serious impact on its performance.

              Have a great weekend!
              BertrandNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Christopher_R, Today, 12:29 AM
              0 responses
              9 views
              0 likes
              Last Post Christopher_R  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              166 responses
              2,235 views
              0 likes
              Last Post sidlercom80  
              Started by thread, Yesterday, 11:58 PM
              0 responses
              3 views
              0 likes
              Last Post thread
              by thread
               
              Started by jclose, Yesterday, 09:37 PM
              0 responses
              8 views
              0 likes
              Last Post jclose
              by jclose
               
              Started by WeyldFalcon, 08-07-2020, 06:13 AM
              10 responses
              1,415 views
              0 likes
              Last Post Traderontheroad  
              Working...
              X