NexusFi: Find Your Edge


Home Menu

 





ATMs in a Strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one max-td with 3 posts (1 thanks)
    2. looks_two foxfox with 3 posts (0 thanks)
    3. looks_3 kkfx with 2 posts (3 thanks)
    4. looks_4 calhawk01 with 1 posts (0 thanks)
    1. trending_up 13,285 views
    2. thumb_up 4 thanks given
    3. group 6 followers
    1. forum 11 posts
    2. attach_file 1 attachments




 
Search this Thread

ATMs in a Strategy

  #1 (permalink)
foxfox
Italy
 
Posts: 13 since Jun 2009
Thanks Given: 0
Thanks Received: 5

Do you have a templete of a Ninja Script Strategy that include an ATM Strategy ?

Tanks

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Diary of a simple price action trader
26 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
22 thanks
My NQ Trading Journal
16 thanks
HumbleTraders next chapter
9 thanks
  #2 (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

What do you mean by template ?

max-td
Reply With Quote
  #3 (permalink)
foxfox
Italy
 
Posts: 13 since Jun 2009
Thanks Given: 0
Thanks Received: 5


An example.

Reply With Quote
  #4 (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

basicly it works like this :


protected override void OnBarUpdate()
{
if (Historical)
return;

// Check for valid condition and create an ATM Strategy
if (Close[0] > SMA(20)[0])
AtmStrategyCreate(Action.Buy, OrderType.Market, 0, 0,
TimeInForce.Day, GetAtmStrategyUniqueId(), "MyTemplate",
GetAtmStrategyUniqueId());
}


and MyTemplate == the name of your created + saved ATM-strategy.
The strategy enters + starts this ATM for Targets+TS+Exit+Stops


you will find more infos here :
https://www.ninjatrader-support.com/HelpGuideV6/helpguide.html?ASMStrategyCreate

max-td
Reply With Quote
  #5 (permalink)
foxfox
Italy
 
Posts: 13 since Jun 2009
Thanks Given: 0
Thanks Received: 5

Ok,
If I want to assign a variable to MyTemplate in order to indicate the name in the strategy property when I started it haw can do ?

Tanks

Reply With Quote
  #6 (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

hmm - dont know if we are talking about the same subject here ...
ATMs are the automated exit-styles - you can define them ie in the chart-trader : ATMStrategys.
You create them with your variables like Lot-size+Stops+targets .... + save them with specific a name
MyTemplate in this case is an example of a name of one ATM you have created yet and that includes all variables you have putted in.
it can also be named as EUROT3 or however.
if your strategy now enters a trade, it enters with this predefined ATM you have choosen in your strategy (ie EUROT3 or MyTemplate)
Then it is like it is - you dont need more variables - its all in the ATM.

Let me know if i dont understand you right.

max-td
Reply With Quote
Thanked by:
  #7 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404

Should be a strategy in your NT samples titled:
"SampleAtmStrategy"

otherwise, you should be able to find it in the NT forums.

kz

Reply With Quote
  #8 (permalink)
 
kkfx's Avatar
 kkfx 
Mumbai, India
 
Experience: Intermediate
Platform: MT4, NT8,TradingView
Broker: AMP
Trading: Index,currencies
Posts: 116 since Jul 2010
Thanks Given: 325
Thanks Received: 160

I am trying to include an ATM template in a strategy, however it does not open the orders as per the ATM strategy. Can anybody correct the code?

I have defined ATM Strategy Tempate as a string in a variable and included in properties.

privatestring aTMStrategyTemplate = @"";

and then this code to call an ATM strategy


if (Historical)
return;

// Check for valid condition and create an ATM Strategy
if (Position.MarketPosition == MarketPosition.Long)
AtmStrategyCreate(OrderAction.Buy, OrderType.Market,
0, 0,
TimeInForce.Day, GetAtmStrategyUniqueId(),
"ATMStrategyTemplate",
GetAtmStrategyUniqueId());

if (Position.MarketPosition == MarketPosition.Short)
AtmStrategyCreate(OrderAction.Sell, OrderType.Market,
0, 0,
TimeInForce.Day, GetAtmStrategyUniqueId(),
"ATMStrategyTemplate",
GetAtmStrategyUniqueId())



Here is a picture with d9 particle oscillator strategy.



Reply With Quote
  #9 (permalink)
 
kkfx's Avatar
 kkfx 
Mumbai, India
 
Experience: Intermediate
Platform: MT4, NT8,TradingView
Broker: AMP
Trading: Index,currencies
Posts: 116 since Jul 2010
Thanks Given: 325
Thanks Received: 160

I searched through the ninjatrader support forum and found a template to include an ATM strategy in a ninjatrader strategy.

1.Select the code under variables, OnBarUpdate and properties sections into the main ninjatrader strategy.

2.Make 2 separate ATM strategies for buy and sell orders in superDOM with the names matching those in a strategy.

3.The orders opened by ther main strategies can now be managed manually by openeing a separate chart of the same instrument and linking that chart and superDOM. The chart trader is disabled on a chart running a strategy.

Here is the zip file for the sample ATM strategy.

Attached Files
Elite Membership required to download: SampleATMstrategyCANCEL.zip
Reply With Quote
  #10 (permalink)
 calhawk01 
baltimore marylnd
 
Experience: Beginner
Platform: ninja
Trading: es
Posts: 91 since May 2013
Thanks Given: 5
Thanks Received: 11


hi, quick question to all

so i'm working with the ''sampleatmstrategy' sample that comes with NT.

i also created an atm strategy on chart trader.

now its time to test to see if it works. but during my test something strange is happening (by design i think).

my orders are being clearly submitted on the order tab in NT. but my orders are not displayed on the chart.

is there a way to get a similar view that chart trader gives you when using atm strategies with your custom trading strategy?

also my realized/unrealized gains for the strategy are not being shown on the strategy tab. nor is my equity changing.

Reply With Quote




Last Updated on November 3, 2014


© 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