NexusFi: Find Your Edge


Home Menu

 





EnterLongLimit(EMA, "myLong")


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one MXASJ with 7 posts (1 thanks)
    2. looks_two max-td with 4 posts (0 thanks)
    3. looks_3 bukkan with 3 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 5,083 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 14 posts
    2. attach_file 0 attachments




 
Search this Thread

EnterLongLimit(EMA, "myLong")

  #1 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800

Hi all,

I'm scratching my head with some trade logic do I'm hoping someone can help. I have a bit of code working just fine where if Price Crossabove EMA, a buy limit order is placed at the "price" of the EMA. The idea is I only want to buy if it retraces back to the EMA.

Here is where I get stuck in logic land... the price keeps going up, and the EMA keeps going up... so I want my EnterLongLimit to equal the EMA as it is rising. Once price drops back to the EMA I should get filled.

Current psuedo code in OnBarUpdate is;

if (goLong) EnterLongLimit(EMA, "myLong");

Which works, but the EnterLongLimit doesn't "chase" and update on change of value of the EMA.

Ideas? Thoughts? Sugesstions?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Better Renko Gaps
The Elite Circle
 
  #3 (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


hi mx,

i do such things with AMTs but with the same concept.

once the order is fired / created i have to adjust it with "AtmStrategyChangeEntryOrder(emawert, 0, entryorderid); "

to follow the EMA-value bar by bar .

thats my solution - still on NT 6,5

max-td
Reply With Quote
  #4 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800

Danke Max,

If I'm not using ATMs I think I may have to use IOrders as it will be a "cancel current BuyLimit/if cancelled enter new BuyLimit" meaning I'm adding some OnOrderUpdate stuff as well. Was hoping for something simple .

Started this thread Reply With Quote
  #5 (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

OK, but there is nothing available like "changing/adjusting the entryorder" for entry-orders ??

i know that changing is much easier + faster then cancelation + sending new orders out with new values - in fact of communication to the exchange.

+ that makes big sense in fast timeframes - like range + tick-stuff.

max-td
Reply With Quote
  #6 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271

if you use the Unmanaged order (in NT7) then you call the ChangeOrder routine and follow the ema as it changes with bar update.

Reply With Quote
  #7 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800


max-td View Post
OK, but there is nothing available like "changing/adjusting the entryorder" for entry-orders ??

i know that changing is much easier + faster then cancelation + sending new orders out with new values - in fact of communication to the exchange.

+ that makes big sense in fast timeframes - like range + tick-stuff.

I'd love to hear that there is! That's how TrailStops work but on the Entry side I think one needs to code it. Open to ideas...

Started this thread Reply With Quote
  #8 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800


bukkan View Post
if you use the Unmanaged order (in NT7) then you call the ChangeOrder routine and follow the ema as it changes with bar update.

Thanks! But according to the manual:

"The Unmanaged approach is reserved for VERY EXPERIENCED programmers." Ninja's highlights

So I'll have to be careful

Reading more about it now.

Started this thread Reply With Quote
  #9 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271


MXASJ View Post
Thanks! But according to the manual:

"The Unmanaged approach is reserved for VERY EXPERIENCED programmers." Ninja's highlights

So I'll have to be careful

Reading more about it now.

well you are very experienced

Reply With Quote
  #10 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800



bukkan View Post
well you are very experienced

I can now lose money in milliseconds! Before I had to wait a whole day!

In the Unmanaged Orders documentation I found this line:

"Unlike the Managed approach where you could modify a working order by calling the entry order method again with your new parameters..."

So I might try that first if I can ensure I'm keeping my position in queue and not doing a cancel/replace if there has been no price change.

All good fun...

Started this thread Reply With Quote




Last Updated on July 16, 2010


© 2024 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 - Privacy Policy - Downloads - Top
no new posts