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 10,779 views
    2. thumb_up 6 thanks given
    3. group 2 followers
    1. forum 13 posts
    2. attach_file 1 attachments




 
Search this Thread
  #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?
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
Day 96 Missiles Hit Kuwait and Bahrain: June 15 Peace at …
Prediction Markets & Event Contracts
Bookmap Global Plus Lifetime + Lifetime Addons For Sale
Platforms and Indicators
$4.5M Floods Russia Nuclear Contract in 24 Hours -- Krem …
Prediction Markets & Event Contracts
Iran Forward Curve: June 30 at 56% vs June 15 at 28% -- …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
15 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #12 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

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 X 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,448 since Apr 2013
Thanks Given: 494
Thanks Received: 1,643

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 X Reply With Quote




Last Updated on March 6, 2018


© 2026 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 - Downloads - Top
no new posts