NexusFi: Find Your Edge


Home Menu

 





Indicator to Strategy HELP!


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one kidvic with 4 posts (0 thanks)
    2. looks_two trendwaves with 3 posts (4 thanks)
    3. looks_3 bltdavid with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 2,542 views
    2. thumb_up 4 thanks given
    3. group 4 followers
    1. forum 10 posts
    2. attach_file 0 attachments




 
Search this Thread

Indicator to Strategy HELP!

  #1 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3

Is there anyway to create a strategy that uses a drawobject?

This is what I want to do.
I have an indicator, that has a:
DrawArrowDown("arrowdn", true, TV, High[TV] + (5 * TickSize), Color.Gold);
Is there a way to trigger off the drawobject itself without looking at the code?

For example:
Say, "if DrawArrowDown is visible on the chart, then set a SellShort LMT order at High[TV]"

As I said, arrowdn MUST be visible because just saying SellShort LMT order at High[TV] returns a number everytime.
So it would be selling all the time.

Thanks in advance.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Exit Strategy
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #3 (permalink)
 bltdavid 
San Jose, CA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Posts: 112 since Dec 2013
Thanks Given: 35
Thanks Received: 103


Can you attach the indicator?

Reply With Quote
  #4 (permalink)
 
MichaelH's Avatar
 MichaelH 
Munich Germany
 
Experience: Intermediate
Platform: NinjaTrader, MetaTrader
Broker: S5
Trading: DAX, ES
Posts: 53 since Dec 2013
Thanks Given: 75
Thanks Received: 43


kidvic View Post
Is there anyway to create a strategy that uses a drawobject?

This is what I want to do.
I have an indicator, that has a:
DrawArrowDown("arrowdn", true, TV, High[TV] + (5 * TickSize), Color.Gold);
Is there a way to trigger off the drawobject itself without looking at the code?

For example:
Say, "if DrawArrowDown is visible on the chart, then set a SellShort LMT order at High[TV]"

As I said, arrowdn MUST be visible because just saying SellShort LMT order at High[TV] returns a number everytime.
So it would be selling all the time.

Thanks in advance.

Dont think its possible to hook on the DrawObjects directly. Assuming you have access to the source of the indicator I would add a DataSeries which holds a value (maybe +1 for UpArrows / -1 for DownArrows) and expose this DataSeries.
Your Strategy can then hook on this DataSerie.

Cheers
Michael

Reply With Quote
  #5 (permalink)
 rename 
Россия
 
Posts: 6 since Dec 2014

No way do that untill indicator will provide DataSerie object. And no matter with or without coding of strategy.

Reply With Quote
  #6 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3

Ok, I have been tinkering:
I've created a bool that toggles true false, when its visible...
Now how do I make a strategy that accesses that bool and also sets a sellshort
Off of the value of a double called TV? My bool and double are under Onbarupdate()

Reply With Quote
  #7 (permalink)
 
trendwaves's Avatar
 trendwaves 
Florida
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader 8
Trading: ES, NQ, CL
Posts: 703 since Dec 2012
Thanks Given: 2,898
Thanks Received: 2,525


kidvic View Post
Ok, I have been tinkering:
I've created a bool that toggles true false, when its visible...
Now how do I make a strategy that accesses that bool and also sets a sellshort
Off of the value of a double called TV? My bool and double are under Onbarupdate()

Maybe post a snip of the code you're focused on in OnBarUpdate() ...

Be Patient and Trade Smart
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #8 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3


trendwaves View Post
Maybe post a snip of the code you're focused on in OnBarUpdate() ...

So I over-simplified it so its pretty straightforward.

When C1 is true, then I want to SELL at TV.
The bool switch is the conditional, and TV contains the value.

protected override void OnBarUpdate()
{
bool C1 = 3 + 3 == 6 ? true : false; // conditional.
double TV = Close[5]; // price to sell.
}

Reply With Quote
  #9 (permalink)
 
trendwaves's Avatar
 trendwaves 
Florida
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader 8
Trading: ES, NQ, CL
Posts: 703 since Dec 2012
Thanks Given: 2,898
Thanks Received: 2,525


kidvic View Post
So I over-simplified it so its pretty straightforward.

When C1 is true, then I want to SELL at TV.
The bool switch is the conditional, and TV contains the value.

protected override void OnBarUpdate()
{
bool C1 = 3 + 3 == 6 ? true : false; // conditional.
double TV = Close[5]; // price to sell.
}


if (C1)
{
EnterShortLimit(DefaultQuantity, TV, "ShortEntry");
SetStopLoss("ShortEntry", CalculationMode.Ticks, StopLossOffsetTicks, false);
SetProfitTarget("ShortEntry", CalculationMode.Ticks, ProfitTargetTicks);
}

Be Patient and Trade Smart
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #10 (permalink)
kidvic
Los Angeles, CA
 
Posts: 92 since Mar 2015
Thanks Given: 13
Thanks Received: 3



trendwaves View Post
if (C1)
{
EnterShortLimit(DefaultQuantity, TV, "ShortEntry");
SetStopLoss("ShortEntry", CalculationMode.Ticks, StopLossOffsetTicks, false);
SetProfitTarget("ShortEntry", CalculationMode.Ticks, ProfitTargetTicks);
}

This script exists inside an indicator, if I create a strategy how do I link it?

Reply With Quote




Last Updated on October 26, 2015


© 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