NexusFi: Find Your Edge


Home Menu

 





question on stop orders in algo


Discussion in NinjaTrader

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




 
Search this Thread

question on stop orders in algo

  #1 (permalink)
 Ssjaznguy 
la puente, California
 
Experience: None
Platform: NinjaTrader
Trading: Es
Posts: 30 since Oct 2018
Thanks Given: 7
Thanks Received: 1

calculatemode = tick
stop placement = 1 tick above or below prior bar high/low depending on direction

My issue is that I have error messages whenever stop price is below market price, or vis versa, how can I prevent this message from popping up (sometimes 500 errors before order get in at the price I want)

I still want my algo to attempt to get in with a stop order as the tick move within the current bar still.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
How to apply profiles
Traders Hideout
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
What broker to use for trading palladium futures
Commodities
 
  #2 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,527 since Oct 2009
Thanks Given: 4,176
Thanks Received: 6,020


Ssjaznguy View Post
calculatemode = tick
stop placement = 1 tick above or below prior bar high/low depending on direction

My issue is that I have error messages whenever stop price is below market price, or vis versa, how can I prevent this message from popping up (sometimes 500 errors before order get in at the price I want)

I still want my algo to attempt to get in with a stop order as the tick move within the current bar still.

before placing your order check the ask or bid price
if (GetCurrentAsk() <= High[1] + 1 * TickSize) the stop order can be safely placed
if (GetCurrentBid() >= Low[1] - 1 * TickSize) the stop order can be safely placed

Reply With Quote
Thanked by:
  #3 (permalink)
 Ssjaznguy 
la puente, California
 
Experience: None
Platform: NinjaTrader
Trading: Es
Posts: 30 since Oct 2018
Thanks Given: 7
Thanks Received: 1


I currently have it the same without the "=". This issue triggers mostly on "traps" after I analyze it more, I am wondering more if there is a place in ninjatrader where I can turn of that particular error message (500+ error message window really drain the comp resource).

Started this thread Reply With Quote
  #4 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,527 since Oct 2009
Thanks Given: 4,176
Thanks Received: 6,020


Ssjaznguy View Post
I currently have it the same without the "=". This issue triggers mostly on "traps" after I analyze it more, I am wondering more if there is a place in ninjatrader where I can turn of that particular error message (500+ error message window really drain the comp resource).

If you can post part of your code and the interval you use maybe we can suggest a more appropriate way to go.

Reply With Quote
  #5 (permalink)
 Ssjaznguy 
la puente, California
 
Experience: None
Platform: NinjaTrader
Trading: Es
Posts: 30 since Oct 2018
Thanks Given: 7
Thanks Received: 1

EntryLong = (High[1] + 1 * TickSize);
StopLossLong = (MIN(Low, 4)[0] - (StopLoss * TickSize));
//Enter Long

if (TDUPriceAction1.TrapLong[0] == 2 && TDUPriceAction1.BarSizeInTicks[1] <= RiskTick && Close[0] >= KAMA1[0] && CCI1[0] <= CCIIndex && (amaMACDBBLines1.Trend[0] == 1 || amaMACDBBLines1.Trend[0] == 2) && EntryLong > GetCurrentAsk())
{
BreakEvenTrigger = true;
SetStopLoss("Long1", CalculationMode.Price, StopLossLong, false);
SetStopLoss("Long2", CalculationMode.Price, StopLossLong, false);
EnterLongStopMarket(Convert.ToInt32(DefaultQuantity), EntryLong, "Long1");
EnterLongStopMarket(Convert.ToInt32(DefaultQuantity), EntryLong, "Long2");
}

Started this thread Reply With Quote




Last Updated on April 16, 2022


© 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