• 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

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 -

    http://www.ninjatrader-support.com/H...verview18.html

    For strategy tutorials -

    http://www.ninjatrader-support.com/H...verview39.html

    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:
              double yestClose = PriorDayOHLC().PriorClose[0]; 
              Print("The prior session close value is " + yestClose.ToString());


              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 Giudiver, Today, 04:29 PM
              0 responses
              7 views
              0 likes
              Last Post Giudiver  
              Started by mlarocco, 03-03-2018, 03:54 PM
              12 responses
              1,298 views
              0 likes
              Last Post SawDr
              by SawDr
               
              Started by TakingStock12, Today, 04:05 PM
              2 responses
              15 views
              0 likes
              Last Post NinjaTrader_ShawnB  
              Started by PageNotFound404, Today, 01:53 PM
              1 response
              14 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by sciman, Today, 08:42 AM
              1 response
              19 views
              0 likes
              Last Post NinjaTrader_Kate  
              Working...
              X