NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 07-12-2010, 08:08 AM   #1
cboat
Member
 
Join Date: Apr 2010
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
Default Adjusting Scalping Amount

I was wondering if there would be any way to adjust my scalping amount depending upon how much slippage I suffer from. My Strategy updates using limit orders. What I would like to do is set the scalp amount a certain distance away from the price that initially received the entry signal.
cboat is offline  
Reply With Quote
Old 07-12-2010, 08:18 AM   #2
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

cboat, could you please clarify what you mean? You can place limit orders at whatever price you want. If you get a signal at a certain price, you can just save that price and submit an order +/- some distance.
NinjaTrader_Austin is offline  
Reply With Quote
Old 07-12-2010, 09:06 AM   #3
cboat
Member
 
Join Date: Apr 2010
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
Default

I understand that. An example would be that my strategy gets it's entry signal at 1.00. Yet due to slippage I do not get a position at 1.00 rather 1.05. Now if my scalp amount is set to 10 cents, is there a way to reduce my scalp by the amount of slippage I had. I.E. .05
cboat is offline  
Reply With Quote
Old 07-12-2010, 09:12 AM   #4
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

cboat, I'm not quite sure what you mean by "reduce my scalp". If I'm interpreting you right, you could create some DataSeries/array of desired fills vs actual fills to get an average slippage and then offset your entry by that amount.
NinjaTrader_Austin is offline  
Reply With Quote
Old 07-12-2010, 10:48 AM   #5
cboat
Member
 
Join Date: Apr 2010
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
Default

i'm sorry i didn't mean "scalp" I meant to say profit taking. And if it is at all possible i would like to run this part of the strategy on every order rather that taking an average.
cboat is offline  
Reply With Quote
Old 07-12-2010, 10:51 AM   #6
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

Then yes, that is definitely possible. You just have to call SetProfitTarget() with the appropriate arguments.
NinjaTrader_Austin is offline  
Reply With Quote
Old 07-14-2010, 09:48 AM   #7
cboat
Member
 
Join Date: Apr 2010
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
Default

is there a way to set my profit target against the close of the previous bar instead of the open of the current bar?
cboat is offline  
Reply With Quote
Old 07-14-2010, 09:51 AM   #8
NinjaTrader_Austin
NinjaTrader Customer Service
 
NinjaTrader_Austin's Avatar
 
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
Default

cboat, yes, you can reference the previous bar's close with Close[1]:
Code:
double prevClose = Close[1];
NinjaTrader_Austin is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop adjusting MasterSepp General Programming 5 12-30-2009 01:10 PM
Do something within a certain amount of bars dwalls General Programming 2 01-21-2009 10:11 AM
Scalping a range bound Forex Pair Serutuf Strategy Development 3 12-31-2008 06:23 AM
Adjusting lot size BIGRED Automated Trading 3 03-21-2008 01:44 PM
Adjusting stop Xkaern Strategy Development 5 01-08-2008 01:45 PM


All times are GMT -6. The time now is 07:11 PM.