![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Apr 2010
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
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.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Apr 2010
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
|
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
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
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.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Apr 2010
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
|
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.
|
|
|
|
|
|
#6 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
Then yes, that is definitely possible. You just have to call SetProfitTarget() with the appropriate arguments.
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Member
Join Date: Apr 2010
Posts: 50
Thanks: 0
Thanked 0 times in 0 posts
|
is there a way to set my profit target against the close of the previous bar instead of the open of the current bar?
|
|
|
|
|
|
#8 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
cboat, yes, you can reference the previous bar's close with Close[1]:
Code:
double prevClose = Close[1];
Austin
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |