Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am trying to write a simple script to cancel an order.
If 2 bars no entry(5 min) = cancel order. I found a script similar in ninja tutorial however this code doesn't work.
I put in my strategy and back-tested and no results.
private IOrder myEntryOrder = null;
private int barNumberOfOrder = 0;
protected override void OnBarUpdate()
{
// Submit an entry order at the low of a bar
if (myEntryOrder == null)
{
myEntryOrder = EnterLongLimit(0, true, 1, Low[0], "Long Entry");
barNumberOfOrder = CurrentBar;
}
// If more than 5 bars has elapsed, cancel the entry order
if (CurrentBar > barNumberOfOrder + 5)
CancelOrder(myEntryOrder);
I have been trading for some time the Alpha Trading Method (and been posting trades to both the thread ATM Trading Method Vendor Free ( and my personal trading journal (.
Credit for the initial posting of the ATM method goes to JDNeeman and …
You will find several types of updates on an order.
Also like dynamically changing a
stop (trailing)
target (turbo)
I did it however still no results
I back-tested. I doesn't make any trades at all. I really don't know where is the problem is.
It doesn't print also:
Print("myEntryOrder to be cancelled: " + myEntryOrder.ToString());
I did it however still no results
I back-tested. I doesn't make any trades at all. I really don't know where is the problem is.
It doesn't print also:
Print("myEntryOrder to be cancelled: " + myEntryOrder.ToString());
1. I would recomend adding some debug information
with Print statements of the value of range
and of your 9 X ticksize
2. also output the limit you are putting on the order
if it enters the iff at all
Same for all other conditions, you will then be able to see step by step what happens.
Thanks,
I opened .cs with .txt file.
However, your project is so complected for me. It is completely out of my scope. I am a novice trader.
And some things are very hard for me to understand.
If you have some simple examples with an order handling that would be great.
Thanks,
Serge
rleplae
you simply take an unzipper
open the archive and inside is a .cs file
use it as an illustration
don't try to run the strategy
however you might find some ideas in the code..