NexusFi: Find Your Edge


Home Menu

 





Question about writing code in Easy language


Discussion in MultiCharts

Updated
      Top Posters
    1. looks_one will4 with 29 posts (1 thanks)
    2. looks_two ABCTG with 26 posts (14 thanks)
    3. looks_3 mattz with 1 posts (0 thanks)
    4. looks_4 Jura with 1 posts (1 thanks)
      Best Posters
    1. looks_one kevinkdog with 1 thanks per post
    2. looks_two Jura with 1 thanks per post
    3. looks_3 ABCTG with 0.5 thanks per post
    4. looks_4 will4 with 0 thanks per post
    1. trending_up 21,184 views
    2. thumb_up 17 thanks given
    3. group 4 followers
    1. forum 58 posts
    2. attach_file 0 attachments




 
Search this Thread
  #21 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

will4,

you will have to use the reserved word Close and make sure that you store it in a variable only once on the last bar. Then use this stored value for your order prices.

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
Memorandum Watch: How the 60-Day MOU Framework Makes May …
Prediction Markets & Event Contracts
Hormuz Surges From 14% to 26.5% Intraday as Irans Answer …
Prediction Markets & Event Contracts
South Korea Suspends Bithumb for Six Months Over AML Fai …
Cryptocurrency
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
22 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Hello Im new here
5 thanks
  #22 (permalink)
will4
sydney,Australila
 
Posts: 31 since Jun 2017
Thanks Given: 13
Thanks Received: 1


ABCTG View Post
will4,

you will have to use the reserved word Close and make sure that you store it in a variable only once on the last bar. Then use this stored value for your order prices.

Regards,

ABCTG

Thanks

How can I be sure that I store it in a variable only once on the last bar?

Regards,
Will


Reply With Quote
  #23 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639


will4,

you could use the the reserved word once for example together with LastBarOnChart.

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:
  #24 (permalink)
will4
sydney,Australila
 
Posts: 31 since Jun 2017
Thanks Given: 13
Thanks Received: 1


ABCTG View Post
will4,

you could use the the reserved word once for example together with LastBarOnChart.

Regards,

ABCTG

Hi
I have written two programs.On the first one the limit order is moving and on the second that I added once lastbaronchart ,the order disappears as the price moves

1)

variables:
var1 (0),
var2 (0),
atsStatus (0);

atsStatus = GetAppInfo(aiStrategyAuto);
If atsStatus=1 then begin
var2=Close+300points ;
var1=Close-300 points;

buy 1 contract next bar at var1 limit ;
sell 1 contract next bar at var2 limit ;
end;

2)

variables:
var1 (0),
var2 (0),
atsStatus (0);

atsStatus = GetAppInfo(aiStrategyAuto);
once (LastBarOnChart =true) begin

If atsStatus=1 then begin
var2=Close+300 points ;
var1=Close-300 points;

buy 1 contract next bar at var1 limit ;
sell 1 contract next bar at var2 limit ;
end;
end;


Reply With Quote
  #25 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

will4,

the code is doing exactly what you wrote it to do. In the first you constantly adjust the price, hence the order gets updated and in the second you don't keep the order alive.

You might want to read about order lifetime and keeping them alive in the MC wiki or help files.

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:
  #26 (permalink)
will4
sydney,Australila
 
Posts: 31 since Jun 2017
Thanks Given: 13
Thanks Received: 1


ABCTG View Post
will4,

the code is doing exactly what you wrote it to do. In the first you constantly adjust the price, hence the order gets updated and in the second you don't keep the order alive.

You might want to read about order lifetime and keeping them alive in the MC wiki or help files.

Regards,

ABCTG

I will read them later ,I want to put a traling stop ,are you aware of any indicator or strategy that is currently in Easy language and I can use it ?


Reply With Quote
  #27 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

will4,

in my opinion not every exit works well with every entry and you will likely have to do some research here. There are reserved words for a trailing stop (like setdollartrailing and setpercenttrailing) and some build in strategies that you can explore, plus you'll likely find a lot of examples via Google.

Regards,

ABCTG


Follow me on X Reply With Quote
Thanked by:
  #28 (permalink)
will4
sydney,Australila
 
Posts: 31 since Jun 2017
Thanks Given: 13
Thanks Received: 1


ABCTG View Post
will4,

in my opinion not every exit works well with every entry and you will likely have to do some research here. There are reserved words for a trailing stop (like setdollartrailing and setpercenttrailing) and some build in strategies that you can explore, plus you'll likely find a lot of examples via Google.

Regards,

ABCTG

Hi, I searched for lectures or texts in MC wiki and help files about"order lifetime and keeping them alive in the MC wiki or help files".I could not find anything .can you tell me what I should read or can you please send me the link so I can study it?


Reply With Quote
  #29 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639

Hi will4,

I am sorry, but I don't have the links handy and would have to dig myself through the documentation, too.

In general Multicharts will keep orders alive as long as the conditions that sent the orders are still present.
That explains the behavior of your second code i.e. why it cancels the order after one bar.

Regards,

ABCTG


will4 View Post
Hi, I searched for lectures or texts in MC wiki and help files about"order lifetime and keeping them alive in the MC wiki or help files".I could not find anything .can you tell me what I should read or can you please send me the link so I can study it?


Follow me on X Reply With Quote
Thanked by:
  #30 (permalink)
will4
sydney,Australila
 
Posts: 31 since Jun 2017
Thanks Given: 13
Thanks Received: 1



ABCTG View Post
Hi will4,

I am sorry, but I don't have the links handy and would have to dig myself through the documentation, too.

In general Multicharts will keep orders alive as long as the conditions that sent the orders are still present.
That explains the behavior of your second code i.e. why it cancels the order after one bar.

Regards,

ABCTG

Hi, Thanks for your reply
How can I keep the order alive? what is the function or reserve word that I can use to keep the order alive?


Reply With Quote




Last Updated on July 14, 2017


© 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