NexusFi: Find Your Edge


Home Menu

 





Creating Arrows


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Saroj with 1 posts (1 thanks)
    2. looks_two MXASJ with 1 posts (1 thanks)
    3. looks_3 max-td with 1 posts (4 thanks)
    4. looks_4 spinnybobo with 1 posts (0 thanks)
    1. trending_up 9,175 views
    2. thumb_up 6 thanks given
    3. group 2 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

Creating Arrows

  #1 (permalink)
 
spinnybobo's Avatar
 spinnybobo 
Crete, IL/USA
 
Experience: Intermediate
Platform: NinjaTrader, Mt4
Broker: Tradestation/Tradestation, NinjaTrader, FXCM and Tallinex
Trading: ES, CL, EUR/USD, TF
Posts: 173 since Aug 2009
Thanks Given: 105
Thanks Received: 61

Hi Everybody

I am just a beginner in programming. I am currently taking a C++ class and I know Ninjatrader is in C# lanuage. So, it will take me a while before I am able to start playing with Ninjascript in terms of creating my own indicators.

The thing I did want to create were some arrows, and I think I can do this with the strategy builder in Ninja trader.

HOWEVER. When I input all of my user defined inputs and my conditions (ie if this happens and this happens, etc..----DO the Following)

I am having a problem with Do the Following. I dont want to create a long trade or short trade. I just want to play a sound and give an arrow. When I just say under Do the Following: play this sound, etc. give Up arrow, etc.. It prints out nothing on the chart!


I dont understand why it prints out nothing on the chart since it is supposed to because it gives the option to do so. Then, when I just say Go Long or Go Short, for example, it works.

So, I guess I could generate my arrows this way since I am only trading on sim, however, my questions are this:
1. Is it possible to just let it go long and short on sim while I also run it on Live? I dont want to take every trade, I just want some arrows to give me a heads up to Pay Attention, my setup is here.

2. Is it possible to generate just the arrows without putting on a long or short position using the strategy builder?

My other option is to use the Indicator builder, but this does not have any videos that I can find, and it is not very intuitive----does not have the same setup as strategy builder which is very logical.

thanks
Spencer

Follow me on Twitter Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
About a successful futures trader who didnt know anythin …
Psychology and Money Management
MC PL editor upgrade
MultiCharts
REcommedations for programming help
Sierra Chart
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #2 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
Posts: 796 since Jun 2009
Thanks Given: 109
Thanks Received: 800

Try this for ideas in your "go long" actions ;
 
Code
                            
{
DrawArrowUp("My up arrow" CurrentBarfalse0Low[0]+(-4*TickSize), Color.Lime);
PlaySound(@"C:\Program Files\NinjaTrader 6.5\sounds\Long ZN.wav");

Remeber to change the name of the wav file to one appropraite for your machine.

Reply With Quote
Thanked by:
  #3 (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


hi spinnybobo,
thanks for bringing up this question in a thread !

here some more stuff for bringing Arrows in your chart - but these things have to be adjusted best in an open code - dont know how flexible the strategy-builder / wizard is.

Tip
For painting arrows you do NOT need a strategy - you can build an indicator that for. if you insert a stratetgy in your chart just for visualisation of arrows you have some limitations like not being able to use charttrader anymore or watch your trades there.



as an indicator with your conditions inside, it shows you the arrows when the conditions are vaild + you can decide if you trade or not - you dont need buy/sell-order stuff.


 
Code
                            

Examples
       
// Paints a red down arrow on the current bar 1 tick above the high 
      
DrawArrowDown("tag1"true0High[0] + TickSizeColor.Red);


     
// Paints a blue down arrown on a three bar reversal pattern (see image below) 

      
if (High[2] > High[3] && High[1] > High[2] && Close[0] < Open[0]) 

          
DrawArrowDown(CurrentBar.ToString(), true0High[0] + TickSizeColor.Blue); 



Syntax

DrawArrowUp(stringtag, bool autoScale, int barsAgo, double y, Color color)



Parameters
tag
A user defined unique id used to reference the draw object. For example, if you pass in a value of "myTag", each time this tag is used, the same draw object is modified. If unique tags are used each time, a new draw object will be created each time.

autoScale
Determines if the draw object will be included in the y-axis scale

barsAgo
The bar the object will be drawn at. A value of 10 would be 10 bars ago.

y
The y value where the arrow is painted (iE 3 ticks above the High of the Bar [0] )

color

max-td
Reply With Quote
Thanked by:
  #4 (permalink)
 
Saroj's Avatar
 Saroj 
Arcata, CA
 
Experience: Intermediate
Platform: NinjaTrader
Trading: index futures, oil
Posts: 485 since Jun 2009
Thanks Given: 232
Thanks Received: 415

max wrote: "as an indicator with your conditions inside, it shows you the arrows when the conditions are vaild + you can decide if you trade or not - you dont need buy/sell-order stuff."

Since the indicator wizard is so lame, I sometimes use the strategy wizard (not often because it is pretty lame too and fraught with bugs) to create the logic and then create a new indicator via the Control Center and cut and past the strategy code into the indicator (but you have to change the namespace to "NinjaTrader.Indicator" (sans quotes)...

I assume this is o.k. to do, but if someone knows differently, please post.

Reply With Quote
Thanked by:




Last Updated on October 15, 2009


© 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