Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help me with a order

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

  • firecan
    replied
    Thanks again I´ll try it.

    Now I Find a problem with these orders:

    Order 1)

    if (Close[0] >= Position.AvgPrice + 8 * TickSize)
    { SetStopLoss(CalculationMode.Price,Position.AvgPric e + 1 * TickSize);}

    Order 2)

    if (Close[0] >= Position.AvgPrice + 14 * TickSize)
    { SetStopLoss(CalculationMode.Price,Position.AvgPric e + 7 * TickSize);}

    While the condition are true the price is going to the new place.

    But if the price down the condition is false and the stop loss returns to the starting point.

    What I'm doing wrong, how I can fix it
    Regards.

    Leave a comment:


  • NinjaTrader_RyanM1
    replied
    Hello firecan,

    This is possible when you connect your NinjaScript stratey to an ATM strategy. Control of these orders is passed on to the ATM strategy and you can manually adjust orders here.

    You can view a sample through Tools > Edit NinjaScript > Strategy > SampleAtmStrategy.

    Leave a comment:


  • firecan
    replied
    Thanks again.

    Once I implemented the strategy, in chart appears the situation of the price entry and stop loss and profit.

    Try changing your position and in a few seconds return to initial place.

    It is possible with any order to let me move and stay in the new place.

    Regards.

    Leave a comment:


  • NinjaTrader_RyanM1
    replied
    Hello firecan,

    If you're looking to define user input parameters, this post can help:
    Creating User Defined Input Parameters


    We realize that lost connections can be frustrating. A connection state between NinjaTrader and your broker/market data vendor is not dictated by NinjaTrader. The NinjaTrader application only reports the connection state as it is reported by the API you are connected through. NinjaTrader behaves like a radio receiver in that it receives signals from the connected server. If the signals are not coming through, the underlying broker/market data vendor API reports this to the NinjaTrader application which in turn reports this back to you. Once a loss of connection is reported, NinjaTrader or the underlying API wil continuously try to re-establish a connection.
    Common reasons that contribute to connection stability are:
    • ISP issues
    • Hardware firewall changing IP addresses frequently
    • Dynamic IP addresses changing frequently intraday. Usually this happens once a week buy you may want to check with your ISP. If they do change daily, requesting a static IP address may help.
    • With Windows XP SP2, if you have more than 10 open TCPIP socket connections (10 programs making socket connections through the internet) Windows will randomly shut down some connections
    • Broker/market data servers may be experiencing temporary downtime

    Leave a comment:


  • firecan
    replied
    Hello again, thank you, now it run correctly.

    I have some questions:

    1) I have opened a real account, need to change some parameters into options. I have seen a video and it changes some of them, is necessary or I can operate since it comes from origin.

    2) While I am connected the ninja connection loses after a time without realizing any action, ¿ comes predetermined for it, is necessary to change any parameter.

    This problem makes me hollow without information when I want to do a replay conection.

    Thank you.

    (sorry, automatic translation)

    Leave a comment:


  • firecan
    replied
    Thanks for your reply.

    I try it right now.

    Regards.

    Leave a comment:


  • NinjaTrader_RyanM1
    replied
    If you're using TickSize, then you want to use whole numbers rather than decimals to express "10 Ticks"

    if (Position.MarketPosition == MarketPosition.Long)
    {
    if ( Close [0] >= Position.AvgPrice + 10 * TickSize)
    {
    SetStopLoss (CalculationMode.Price, Position.AvgPrice + TickSize);
    }
    }

    Leave a comment:


  • firecan
    replied
    if ( Close [0] >= Position.AvgPrice = + 0.0010 * TickSize)
    {SetStopLoss (CalculationMode.Price,Position.AvgPrice+0,0001);}

    Leave a comment:


  • firecan
    replied
    Hello again.

    I am looking for the order correct order that, after having a long entry, send the Stop Loos to Breakeven+1 when the price arrive +10 ticks from entry price.

    Regards.

    Leave a comment:


  • NinjaTrader_RyanM1
    replied
    Hello firecan,

    Can you let us know what it is you're looking to express here?

    Leave a comment:


  • firecan
    replied
    Hello again

    I run this code with CalculateOnBarClose set to false in realtime trading. And not OK.

    I need to know the code that I need change here. (Entry Price)

    if ( ____________________ >= Position.AvgPrice + 0.0010 * TickSize)
    { SetStopLoss(CalculationMode.Price,Position.AvgPric e +0.0001); }

    Regards.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    firecan, you could simply run this code with CalculateOnBarClose set to false in realtime trading, it would then update the Close[0] value intrabar as the bar develops. Should you want to trigger certain conditions still on bar close, please review this sample showing a dual approach to setting this property -

    Leave a comment:


  • firecan
    replied
    Price to Breakeven without wait close (0)

    Hello again, I try with samples but don´t speak about prices only SMA. Please can you tell me, what I need change in this code:

    // When the pryce is more big than entry price +0.0010 ticks send Stop Loss to Breakeven.

    if ( Close (0) >= Position.AvgPrice + 0.0010 * TickSize)
    { SetStopLoss(CalculationMode.Price,Position.AvgPric e -0.0001); }

    this code need whait close bar (0)

    ----------------------------------------------------------------------------------

    if ( ?????? >= Position.AvgPrice + 0.0010 * TickSize)
    { SetStopLoss(CalculationMode.Price,Position.AvgPric e +0.0001); }

    Regards.

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    firecan, unfortunately you would run into the 'internal order handling rules' with this approach - http://www.ninjatrader-support.com/H...verview36.html

    You would see this with TraceOrders as debug tool enabled in your script -



    A workaround is to monitor price and only place one order as needed and CancelOrder the other working one, so you would only have one working order all the time in this case.

    Leave a comment:


  • firecan
    replied
    Help me with a order

    Hello, someone can help me with the following order.

    I try to throw two orders simultaneously to the market.

    One (Long) to the current price +10 pips

    and another (Short) to the current price-10 pips

    I can to do it but in two script different one for Long and other one for Short, I expect it could unify the order.

    -----------------------------------------------------------------------------------------------------

    // Condition Long.
    if (ToTime(Time[0]) == ToTime(horas,minutos,segundos))
    { EnterLongStop(contratos,Close[0]+10, ""); }

    ------------------------------------------------------------------------------------------------------

    // Condition Short.
    if (ToTime(Time[0]) == ToTime(horas,minutos,segundos))
    { EnterShortStop(contratos,Close[0]-10, ""); }

    --------------------------------------------

    If I put both orders in the same script only send the first one order, already is short or long.

    I wait there exists some order or way of putting these orders in the same script.

    Thanks.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Davide999, 05-18-2023, 03:55 AM
4 responses
554 views
1 like
Last Post kcwasher  
Started by Stanfillirenfro, Today, 07:23 AM
2 responses
10 views
0 likes
Last Post Stanfillirenfro  
Started by rexsole, Today, 08:39 AM
2 responses
6 views
0 likes
Last Post NinjaTrader_Erick  
Started by cmtjoancolmenero, Yesterday, 03:58 PM
6 responses
29 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by gbourque, Today, 06:39 AM
2 responses
14 views
0 likes
Last Post gbourque  
Working...
X