NexusFi: Find Your Edge


Home Menu

 





Looking for Linear Regression Indicator code that display up and down trend


Discussion in EasyLanguage Programming

Updated
    1. trending_up 5,539 views
    2. thumb_up 6 thanks given
    3. group 2 followers
    1. forum 13 posts
    2. attach_file 1 attachments




 
Search this Thread

Looking for Linear Regression Indicator code that display up and down trend

  #11 (permalink)
Dvdkite
Trieste Italy
 
Posts: 162 since Feb 2018
Thanks Given: 131
Thanks Received: 25


ABCTG View Post
Dvdkite,

the only thing to keep in mind that unless you are working with intra bar order generation, your stop and target won't be placed during the entry bar with the code you posted.

Regards,

ABCTG

That's interesting to understand. So, I'm using 100 tick bars setup for the graph in my strategy, and it could be a problem beacause if in those 100 tick the price drop down more that the Stop Loss it can lost more since the stop order goes live.

Shall I simply set
 
Code
[IntrabarOrderGeneration = true]
to avoid this problem? Will, by this way, the system send the stop on takeprofit orders immediately after execution of the entry?

The problem is that I have an entry conditions(for example for LONG ENTRY) that has to open a position " at the close of the bar after the bar of the linear regression color change " ( basically at the close price of the bar after the bar with LINEAR_REG > LINEAR_REG[1]). So here I don't want it to be executed during intrabar time...
but of course I want se send IMMEDIATELY the SL e TP order even in intrabars....

Could it be a solution to set [IntrabarOrderGeneration = true] before the stop loss and take profit orders and then se it FALSE after that?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
What broker to use for trading palladium futures
Commodities
About a successful futures trader who didn´t know anyth …
Psychology and Money Management
MC PL editor upgrade
MultiCharts
 
  #12 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Dvdkite,

attributes like IntrabarOrderGeneration are global for your code, you can't switch them on and off or have it only work for a section within the same code. They would allow to issue the stop and target directly after an entry, but you can accomplish the same using SetStopLoss and SetProfitTarget.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #13 (permalink)
Dvdkite
Trieste Italy
 
Posts: 162 since Feb 2018
Thanks Given: 131
Thanks Received: 25



ABCTG View Post
Dvdkite,

the only thing to keep in mind that unless you are working with intra bar order generation, your stop and target won't be placed during the entry bar with the code you posted.

Regards,

ABCTG

Hello again,


So If I understood correctly the "trick" is simply to use SetStopLoss and SetProfitTarget. Both will be executed "REALLY" next tick (so intrabar) Even if for this strategy intrabar order generation is false.

On the other side, if in another stategy I'm going to use intrabar order generation TRUE, the orders below will be executed at the same time as they would be in the form of SetStopLoss and SetProfitTarget.

Am I correct?
Thanks

David

Reply With Quote
  #14 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Dvdkite,

I would suggest testing it, so you can see for yourself. The reserved words SetStopLoss and SetProfitTarget can trigger the exits during the bar.

When using intrabar order generation the stop and target orders in your code would be placed as soon as the code detects the MarketPosition being +1 or -1.

Regards,

ABCTG

Follow me on Twitter Reply With Quote




Last Updated on March 6, 2018


© 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