NexusFi: Find Your Edge


Home Menu

 





3 buy orders


Discussion in NinjaTrader

Updated
    1. trending_up 1,813 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 6 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
giger2000
Barcelona
 
Posts: 15 since Sep 2013
Thanks Given: 1
Thanks Received: 2

Hi,

I'm trying to programme and strategy based on High[2]

When high[2]>CurrentAsk+Diferencial, i would plce 3 limit buy orders, but it doesn't works. Colud you help me?


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Topstep Acquires The Futures Desk -- Prop Firm Consolida …
Funded Trading Evaluation Firms
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
TradingView Opens Volume Footprint Data to Pine Script - …
TradingView
The Backwardation Signal: How the CL Futures Curve Tells …
Commodities
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Legendary Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,951 since Dec 2010
Thanks Given: 3,042
Thanks Received: 2,397



giger2000 View Post
Hi,

I'm trying to programme and strategy based on High[2]

When high[2]>CurrentAsk+Diferencial, i would plce 3 limit buy orders, but it doesn't works. Colud you help me?

Can you post your Strategy, easier to answer....


Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: [wiki=NT-Local-Order-Manager-LOM-Guide][/wiki]
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
giger2000
Barcelona
 
Posts: 15 since Sep 2013
Thanks Given: 1
Thanks Received: 2


NJAMC View Post
Can you post your Strategy, easier to answer....


As you'd see, I want to plce 3 orders, only if 1 order is executet. Orders limit doesn't works me.

Tks


Attached Files
Elite Membership required to download: 3orders.zip
Reply With Quote
  #5 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Legendary Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,951 since Dec 2010
Thanks Given: 3,042
Thanks Received: 2,397


giger2000 View Post
As you'd see, I want to plce 3 orders, only if 1 order is executet. Orders limit doesn't works me.

Tks

@giger2000,

A quick look at this indicates there may be an assumption you are making. Once the FLAT triggers and enters the first limit order, the status of LONG is not valid until most likely the next Bar (or a few Ticks later if you are on COBC=false). So expect the next bar to place the additional positions.

 
Code
        protected override void OnBarUpdate()
        {
            // Condition set 1
            if (High[NumBarras] >= GetCurrentAsk()+DistCompra1)
            {
			if (Positions[0].MarketPosition==MarketPosition.Flat){//If position=0, buy first order
				Print("Vamos a comprar");

                	EnterLongLimit(QtyCompra, GetCurrentAsk(), "Compra1");
	    }
	    if (Positions[0].MarketPosition==MarketPosition.Long)//if buy1 is do it, let's place order 2 and 3, with limit price
	    {
                	EnterLongLimit(QtyCompra, GetCurrentAsk()-DistCompra2, "Compra2");
		        EnterLongLimit(QtyCompra, GetCurrentAsk()-DistCompra3, "Compra3");
	    }
        }
Have you tried this strategy with:
CalculateOnBarClose = false;

Also, I am not certain as I haven't played with these NT functions in a while, but I seem to remember NT will not let you set a LONG LIMIT below the ASK price. Even your first "Compra1", this could be below the Ask by the time it is processed and get rejected. I think I understand why this is a desirable setup and one of the reasons I started working on LOM to get around some of the NT7 limitations, but I don't think this approach will work at your broker either (even if you manually entered the orders). Test this by adding to the Ask() in all 3 Limit orders to see if they are entered, i suspect they will be.


Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: [wiki=NT-Local-Order-Manager-LOM-Guide][/wiki]
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
giger2000
Barcelona
 
Posts: 15 since Sep 2013
Thanks Given: 1
Thanks Received: 2


NJAMC View Post
@giger2000,

A quick look at this indicates there may be an assumption you are making. Once the FLAT triggers and enters the first limit order, the status of LONG is not valid until most likely the next Bar (or a few Ticks later if you are on COBC=false). So expect the next bar to place the additional positions.

 
Code
        protected override void OnBarUpdate()
        {
            // Condition set 1
            if (High[NumBarras] >= GetCurrentAsk()+DistCompra1)
            {
			if (Positions[0].MarketPosition==MarketPosition.Flat){//If position=0, buy first order
				Print("Vamos a comprar");

                	EnterLongLimit(QtyCompra, GetCurrentAsk(), "Compra1");
	    }
	    if (Positions[0].MarketPosition==MarketPosition.Long)//if buy1 is do it, let's place order 2 and 3, with limit price
	    {
                	EnterLongLimit(QtyCompra, GetCurrentAsk()-DistCompra2, "Compra2");
		        EnterLongLimit(QtyCompra, GetCurrentAsk()-DistCompra3, "Compra3");
	    }
        }
Have you tried this strategy with:
CalculateOnBarClose = false;

Also, I am not certain as I haven't played with these NT functions in a while, but I seem to remember NT will not let you set a LONG LIMIT below the ASK price. Even your first "Compra1", this could be below the Ask by the time it is processed and get rejected. I think I understand why this is a desirable setup and one of the reasons I started working on LOM to get around some of the NT7 limitations, but I don't think this approach will work at your broker either (even if you manually entered the orders). Test this by adding to the Ask() in all 3 Limit orders to see if they are entered, i suspect they will be.

I think that i've low level for understand LOM function. could you help me?


Reply With Quote
  #7 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Legendary Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,951 since Dec 2010
Thanks Given: 3,042
Thanks Received: 2,397


giger2000 View Post
I think that i've low level for understand LOM function. could you help me?

Hi @giger2000,

I am not sure it is possible to do what you intend, hopefully one of the experienced traders can tell you if that is the case.

I haven't used LOM recently and fairly tied up with other activities. I would suggest you use the Elite Thread:


And the WIKI:
https://nexusfi.com/wiki/trading-wiki/NT-Local-Order-Manager-LOM-Guide?redirect=no

Also looks like you may not be an elite member so you are unlikely able to get access to the source code.


Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: [wiki=NT-Local-Order-Manager-LOM-Guide][/wiki]
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Reply With Quote




Last Updated on October 27, 2013


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts