Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry Price Generation

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

    Entry Price Generation

    Hey!


    I'm pretty new to NT - but loving it - and I can't figure something out...

    How do you generate a price for entry in a strategy?

    I understand you can put in price dependant on OHLC as many ticks back etc

    but say I wanted to do something slightly different
    for example....

    Say I want to place a market order if price moves n% after an indicator goes off [not within a certain time frame]

    Is there a simple way of doing this in the Backtesting /Strategy wizard?

    I was trying to do something like this in Conditions and Actions
    Variable0 = High[0]
    Variable1 = 1.05
    Variable2 = Variable0 x Variable1
    EnterLongLimit(DefaultQuantity, Variable2, "SignalPriceVariable2")

    But when I try it - Variable2 defaults to '0'
    And nothing happens

    Thanks in advance!

    #2
    Hello,

    Try Print()'ing out the variable 2 after you do the multiplication but before your order entry. What do you get?
    DenNinjaTrader Customer Service

    Comment


      #3
      Yea.... lotsa errors

      Error msg in Log:


      Calculated trail stop price for strategy 'MyStrategyTester' was smaller/equal 0. No trail stop order placed.



      Code looks like this now:

      Variable0 = High[0];
      Variable1 = 1.05;
      Variable2 = (Variable1 * Variable0);
      PrintWithTimeStamp("Variable2");
      EnterLongLimit(DefaultQuantity, Variable2, "SignalLong1");


      Could this be due to the fact I'm trying to enter a limit order above market price [perhaps it 'should be' a 'Simulated Stop Order']

      Thanks!

      Comment


        #4
        Hello,

        That might be it. Try placing a stop or stoplimit above the market on the buy side or a limit above the market on the sell side and see if that helps.
        DenNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by trilliantrader, 04-18-2024, 08:16 AM
        4 responses
        18 views
        0 likes
        Last Post trilliantrader  
        Started by mgco4you, Today, 09:46 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by wzgy0920, Today, 09:53 PM
        0 responses
        9 views
        0 likes
        Last Post wzgy0920  
        Started by Rapine Heihei, Today, 08:19 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by Rapine Heihei, Today, 08:25 PM
        0 responses
        10 views
        0 likes
        Last Post Rapine Heihei  
        Working...
        X