NexusFi: Find Your Edge


Home Menu

 





ORDER PENDING


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one firecan with 3 posts (0 thanks)
    2. looks_two max-td with 2 posts (0 thanks)
    3. looks_3 Xeno with 2 posts (0 thanks)
    4. looks_4 Big Mike with 1 posts (0 thanks)
    1. trending_up 3,750 views
    2. thumb_up 0 thanks given
    3. group 3 followers
    1. forum 8 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 
firecan's Avatar
 firecan 
sevilla
 
Experience: Intermediate
Platform: Ninja Trader
Trading: futures
Posts: 29 since Nov 2010
Thanks Given: 9
Thanks Received: 3

Hi, I want to send a pending order when the market reaches a certain price. (NT)

Is this possible ?

CODE:

if (Price = touch_price)
{EnterLong (0,true,contrats,Close[0]+DistanceMarket*TickSize, "Open Long 1");}

Regards.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Powell in 48 Hours: Word Markets Give 78% on Inflation, …
Prediction Markets & Event Contracts
Day 96 Missiles Hit Kuwait and Bahrain: June 15 Peace at …
Prediction Markets & Event Contracts
Zytrade: Devin Brady, CEO - Ask Me Anything (AMA)
Brokers
UMA Votes Tonight: Polymarkets $80M Strategy Bitcoin Bat …
Prediction Markets & Event Contracts
Wood Mackenzie Drops $200 Oil Forecast -- Airspace Expir …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
2026 Fire Horse
5 thanks
  #3 (permalink)
 Xeno 
UK
 
Experience: Intermediate
Platform: Ninja
Broker: Mirus/Zen
Trading: Futures - bonds, currencies, index
Posts: 288 since Oct 2010
Thanks Given: 70
Thanks Received: 274


If you want to go long, use one of these

EnterLongStop
EnterLongLimit

Stop for entries above the current price, and limit for entries below. Replace Long with Short to go short.


Reply With Quote
  #4 (permalink)
 
firecan's Avatar
 firecan 
sevilla
 
Experience: Intermediate
Platform: Ninja Trader
Trading: futures
Posts: 29 since Nov 2010
Thanks Given: 9
Thanks Received: 3

Hello again, thank you.

The problem is to write the code that generates the entry.

Can you help me.

_________________________________________________________
Variables

private int touch_price = 1,2345

if (Price = touch_price) // This is wrong code - need change it -

{EnterLongStop (0,true,contrats,Close[0]+DistanceMarket*TickSize, "Open Long 1");}
__________________________________________________________

Regards.

Salvador.


Started this thread Reply With Quote
  #5 (permalink)
 Xeno 
UK
 
Experience: Intermediate
Platform: Ninja
Broker: Mirus/Zen
Trading: Futures - bonds, currencies, index
Posts: 288 since Oct 2010
Thanks Given: 70
Thanks Received: 274

I'm not sure exactly what you're having trouble with. Your if statement needs == rather than =

Was that all?


Reply With Quote
  #6 (permalink)
 
firecan's Avatar
 firecan 
sevilla
 
Experience: Intermediate
Platform: Ninja Trader
Trading: futures
Posts: 29 since Nov 2010
Thanks Given: 9
Thanks Received: 3

Hello again.

I've tried with:

privateint touch_price = 1,4030; // 6E
private boll touch_price = 1,4030; // 6E
private double touch_price = 1,4030; // 6E

And in any case accept decimals.

Also:

if (Position.AvgPrice == touch_price);
GoLong();


I don't know if it works with (Position.AvgPrice == touch_price); .Becasue do not let me compile it by not allowing decimals.

Could you help me.

Greetings.


Started this thread Reply With Quote
  #7 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,669 since Jun 2009
Thanks Given: 33,669
Thanks Received: 102,557


firecan View Post
Hello again.

I've tried with:

privateint touch_price = 1,4030; // 6E
private boll touch_price = 1,4030; // 6E
private double touch_price = 1,4030; // 6E

And in any case accept decimals.

Also:

if (Position.AvgPrice == touch_price);
GoLong();


I don't know if it works with (Position.AvgPrice == touch_price); .Becasue do not let me compile it by not allowing decimals.

Could you help me.

Greetings.

You need to wrap code snippets in the [code]put code here[/code] tags to prevent bad formatting on the forum.

It sounds like what you are wanting is called Market On Touch. You'll have to run your strategy with COBC = false to monitor tick by tick.

You seem to be saying you are getting an error message. It would be helpful if you would post a screen shot of the error message, but my guess from your posts is that you need to use a dot . not a comma , in the double. BTW, an int cannot have decimals, and a boolean cannot have decimals.

I suggest you study some existing strategy and indicator code, there are hundreds available on this site. Read line by line and you will begin to understand what you can do from others working examples.

Mike




We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on X Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 
max-td's Avatar
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
Posts: 1,752 since Jun 2009
Thanks Given: 2,309
Thanks Received: 927


firecan View Post
Hello again.

I've tried with:

privateint touch_price = 1,4030; // 6E
private boll touch_price = 1,4030; // 6E
private double touch_price = 1,4030; // 6E

And in any case accept decimals.

Also:

if (Position.AvgPrice == touch_price);
GoLong();


I don't know if it works with (Position.AvgPrice == touch_price); .Becasue do not let me compile it by not allowing decimals.

Could you help me.

Greetings.


maybe this helps for one step ahead ....

your last sentence explains one problem to me

decimals in codes dont like comma but they need to be written with points
try it like this :

 
Code
                            
private int touch_price =  1.4030// 6E
private bool touch_price =  1.4030// 6E 
private double touch_price =  1.4030// 6E 

and report
-


max-td
Reply With Quote
  #9 (permalink)
 
max-td's Avatar
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
Posts: 1,752 since Jun 2009
Thanks Given: 2,309
Thanks Received: 927

ooops,
mike wrote something like this yet


Quoting 
by mike : You seem to be saying you are getting an error message. It would be helpful if you would post a screen shot of the error message, but my guess from your posts is that you need to use a dot . not a comma , in the double. BTW, an int cannot have decimals, and a boolean cannot have decimals.

i am still sleepy a bit here it seems


max-td
Reply With Quote




Last Updated on November 30, 2010


© 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