![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Junior Member
Join Date: Apr 2007
Location: , ,
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
|
Hi,
I'm a bit new at NinjaScript so please forgive if this is a stupid question. (i do have some .NET programming experience) Is there any class/object providing info (entry price, exit price, profit/loss, time. etc. etc.) about specific trades? For example, unsing NinjaScripthow would I determine if the previous trade of the day was a winner or loser? I came across this requirement while trying to convert some of my EasyLanguage code to NinjaScript. Any response much appreciated. Regards, Jerry |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
>> Is there any class/object providing info (entry price, exit price, profit/loss, time. etc. etc.) about specific trades?
You could try playing with a 1 tick series which holds all trades of the complete lookback period >> For example, unsing NinjaScripthow would I determine if the previous trade of the day was a winner or loser? StrategyBase.Performance.AllTrades is a collection of all trades of the strategy (pls serach docs for AllTrades).
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Apr 2007
Location: , ,
Posts: 26
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks for the response.
>>StrategyBase.Performance.AllTrades is a collection of all trades of the strategy (pls serach docs for AllTrades). Yes, but how does one reference individual trades in the collection and expose its properties? |
|
|
|
|
|
#4 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Sorry, indexed access it not supported at this time. This is "only" an enumerator.
Dierk
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|